1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-14 22:29:14 +00:00

Ignore OperationalError in db upgrade.

This commit is contained in:
cuihaikuo
2018-07-09 18:09:42 +08:00
parent 7c09f53be6
commit e5ae34bef7

View File

@@ -352,12 +352,8 @@ class MySQLDBUpdater(DBUpdater):
cursor.execute(sql) cursor.execute(sql)
conn.commit() conn.commit()
except Exception, e: except Exception, e:
if isinstance(e, MySQLdb.OperationalError): msg = str(e)
msg = str(e.args[1]) Utils.warning('Failed to execute sql: %s' % msg)
Utils.error('Failed to execute sql: %s' % msg)
else:
msg = str(e)
Utils.warning('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: