Rev1427, Skip invalid files on dbRebuild

This commit is contained in:
shortcutme 2016-08-27 11:01:41 +02:00
parent 3ce11a0dab
commit 887a07c3fb
2 changed files with 7 additions and 3 deletions

View file

@ -8,7 +8,7 @@ class Config(object):
def __init__(self, argv): def __init__(self, argv):
self.version = "0.4.0" self.version = "0.4.0"
self.rev = 1426 self.rev = 1427
self.argv = argv self.argv = argv
self.action = None self.action = None
self.config_file = "zeronet.conf" self.config_file = "zeronet.conf"

View file

@ -118,8 +118,12 @@ class SiteStorage(object):
s = time.time() s = time.time()
try: try:
for file_inner_path, file in self.getDbFiles(): for file_inner_path, file in self.getDbFiles():
try:
if self.db.loadJson(file_inner_path, file=file, cur=cur): if self.db.loadJson(file_inner_path, file=file, cur=cur):
found += 1 found += 1
except Exception, err:
self.log.error("Error importing %s: %s" % (file_inner_path, Debug.formatException(err)))
finally: finally:
cur.execute("END") cur.execute("END")
self.log.info("Imported %s data file in %ss" % (found, time.time() - s)) self.log.info("Imported %s data file in %ss" % (found, time.time() - s))