mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-13 13:51:53 +00:00
Ignore non-fatal errors in database upgrade.
This commit is contained in:
@@ -43,6 +43,10 @@ class Utils(object):
|
|||||||
def info(msg):
|
def info(msg):
|
||||||
print Utils.highlight('[INFO] ') + msg
|
print Utils.highlight('[INFO] ') + msg
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def warning(msg):
|
||||||
|
print Utils.highlight('[WARNING] ') + msg
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def error(msg):
|
def error(msg):
|
||||||
print Utils.highlight('[ERROR] ') + msg
|
print Utils.highlight('[ERROR] ') + msg
|
||||||
@@ -350,10 +354,10 @@ class MySQLDBUpdater(DBUpdater):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
if isinstance(e, MySQLdb.OperationalError):
|
if isinstance(e, MySQLdb.OperationalError):
|
||||||
msg = str(e.args[1])
|
msg = str(e.args[1])
|
||||||
|
Utils.error('Failed to execute sql: %s' % msg)
|
||||||
else:
|
else:
|
||||||
msg = str(e)
|
msg = str(e)
|
||||||
|
Utils.warning('Failed to execute sql: %s' % msg)
|
||||||
Utils.error('Failed to execute sql: %s' % msg)
|
|
||||||
|
|
||||||
def apply_sqls(self, info, sql_path):
|
def apply_sqls(self, info, sql_path):
|
||||||
with open(sql_path, 'r') as fp:
|
with open(sql_path, 'r') as fp:
|
||||||
|
Reference in New Issue
Block a user