Sometimes a database could not be created because of the connection to 'template1'

This fix should correct the problem (tested with 1 second but reduced to 0.2 second)

bzr revid: olt@tinyerp.com-20081208075558-1kfm6rf25nrinwfv
This commit is contained in:
Olivier Laurent
2008-12-08 08:55:58 +01:00
parent b08432d356
commit 8cbf75d090
+1
View File
@@ -67,6 +67,7 @@ class db(netsvc.Service):
db = sql_db.db_connect('template1', serialize=1)
db.truedb.autocommit()
cr = db.cursor()
time.sleep(0.2)
cr.execute('CREATE DATABASE ' + db_name + ' ENCODING \'unicode\'')
cr.close()
class DBInitialize(object):