From 4890c4cb2fbf5a308de50f53d5a2bba278efe21b Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 7 Nov 2016 23:43:08 +0100 Subject: [PATCH] Fix big site download --- src/Content/ContentManager.py | 3 +++ src/Site/SiteManager.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index cb9db3af..cd056851 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -675,6 +675,9 @@ class ContentManager(object): # Check total site size limit if site_size > site_size_limit: self.log.error("%s: Site too large %s > %s, aborting task..." % (inner_path, site_size, site_size_limit)) + if inner_path == "content.json" and self.site.settings["size"] == 0: + # First content.json download, save site size to display warning + self.site.settings["size"] = site_size task = self.site.worker_manager.findTask(inner_path) if task: # Dont try to download from other peers self.site.worker_manager.failTask(task) diff --git a/src/Site/SiteManager.py b/src/Site/SiteManager.py index 79a47338..ee22aa1b 100644 --- a/src/Site/SiteManager.py +++ b/src/Site/SiteManager.py @@ -120,7 +120,7 @@ class SiteManager(object): site.settings["serving"] = True site.saveSettings() if all_file: # Also download user files on first sync - site.download(blind_includes=True) + site.download(check_size=True, blind_includes=True) else: if all_file: site.download()