зеркало из https://github.com/mozilla/treeherder.git
Bug 1303102 - Use autocommit for the run_sql command
This prevents changes from being discarded if the DB connection timed out between the `.execute()` call being made, and it completing.
This commit is contained in:
Родитель
9d7102c854
Коммит
c8802ef7ef
|
@ -75,8 +75,8 @@ class Command(BaseCommand):
|
|||
)
|
||||
try:
|
||||
cursor = conn.cursor()
|
||||
conn.autocommit(True)
|
||||
cursor.execute(sql_code)
|
||||
conn.commit()
|
||||
self.stdout.write("Sql code executed on {}:".format(datasource))
|
||||
for row in cursor:
|
||||
self.stdout.write(" {}".format(row))
|
||||
|
|
Загрузка…
Ссылка в новой задаче