Rev1909, Rebuild content.db on error
This commit is contained in:
parent
f5fb6b83ff
commit
23dc8e063c
2 changed files with 12 additions and 3 deletions
|
@ -10,7 +10,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.5.2"
|
||||
self.rev = 1905
|
||||
self.rev = 1909
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.config_file = "zeronet.conf"
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import time
|
||||
import os
|
||||
|
||||
from Db import Db
|
||||
from Config import config
|
||||
from Plugin import PluginManager
|
||||
from Debug import Debug
|
||||
|
||||
|
||||
@PluginManager.acceptPlugins
|
||||
|
@ -10,6 +12,13 @@ class ContentDb(Db):
|
|||
def __init__(self, path):
|
||||
Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
|
||||
self.foreign_keys = True
|
||||
try:
|
||||
self.schema = self.getSchema()
|
||||
self.checkTables()
|
||||
except Exception, err:
|
||||
self.log.error("Error loading content.db: %s, rebuilding..." % Debug.formatException(err))
|
||||
self.close()
|
||||
os.unlink(path) # Remove and try again
|
||||
self.schema = self.getSchema()
|
||||
self.checkTables()
|
||||
self.site_ids = {}
|
||||
|
|
Loading…
Reference in a new issue