Fix startup with 1000+ sites
This commit is contained in:
parent
59205088d2
commit
dae5cd3969
1 changed files with 4 additions and 3 deletions
|
@ -46,9 +46,10 @@ class SiteManager(object):
|
|||
self.log.debug("Removed site: %s" % address)
|
||||
|
||||
# Remove orpan sites from contentdb
|
||||
for row in ContentDb.content_db.execute("SELECT * FROM site WHERE ?", {"not__address": self.sites.keys()}):
|
||||
self.log.info("Deleting orphan site from content.db: %s" % row["address"])
|
||||
ContentDb.content_db.deleteSite(row["address"])
|
||||
for row in ContentDb.getContentDb().execute("SELECT * FROM site"):
|
||||
if row["address"] not in self.sites:
|
||||
self.log.info("Deleting orphan site from content.db: %s" % row["address"])
|
||||
ContentDb.getContentDb().deleteSite(row["address"])
|
||||
|
||||
if added:
|
||||
self.log.debug("SiteManager added %s sites" % added)
|
||||
|
|
Loading…
Reference in a new issue