From ae092dc757a91948c159462ca50217cea02eae06 Mon Sep 17 00:00:00 2001 From: HelloZeroNet Date: Sat, 19 Mar 2016 18:05:49 +0100 Subject: [PATCH] Disable DB updating command line argument --- src/Config.py | 1 + src/Site/SiteStorage.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Config.py b/src/Config.py index b93b2fb7..f68cf18f 100644 --- a/src/Config.py +++ b/src/Config.py @@ -146,6 +146,7 @@ class Config(object): self.parser.add_argument('--trackers_file', help='Load torrent trackers dynamically from a file', default=False, metavar='path') self.parser.add_argument('--use_openssl', help='Use OpenSSL liblary for speedup', type='bool', choices=[True, False], default=use_openssl) + self.parser.add_argument('--disable_db', help='Disable database updating', action='store_true') self.parser.add_argument('--disable_encryption', help='Disable connection encryption', action='store_true') self.parser.add_argument('--disable_sslcompression', help='Disable SSL compression to save memory', type='bool', choices=[True, False], default=True) diff --git a/src/Site/SiteStorage.py b/src/Site/SiteStorage.py index a6102bb4..0ca8444b 100644 --- a/src/Site/SiteStorage.py +++ b/src/Site/SiteStorage.py @@ -184,7 +184,7 @@ class SiteStorage: # Reopen DB to check changes self.closeDb() self.openDb() - elif inner_path.endswith(".json") and self.has_db: # Load json file to db + elif not config.disable_db and inner_path.endswith(".json") and self.has_db: # Load json file to db self.log.debug("Loading json file to db: %s" % inner_path) try: self.getDb().loadJson(file_path)