Delayed save of sites.json

This commit is contained in:
shortcutme 2019-08-02 14:06:25 +02:00
parent f6e06456b0
commit 1eb97ea381
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 5 additions and 1 deletions

View file

@ -11,6 +11,7 @@ from Plugin import PluginManager
from Content import ContentDb
from Config import config
from util import helper
from util import RateLimit
@PluginManager.acceptPlugins
@ -82,6 +83,9 @@ class SiteManager(object):
self.log.debug("SiteManager added %s sites" % added)
self.loaded = True
def saveDelayed(self):
RateLimit.callAsync("Save sites.json", allowed_again=5, func=self.save)
def save(self, recalculate_size=False):
if not self.sites:
self.log.debug("Save skipped: No sites found")