Commit a3dc14b3 authored by Anze Vavpetic's avatar Anze Vavpetic

close connection after context is initialized.

parent de0e9728
......@@ -176,6 +176,8 @@ if USE_CONCURRENCY:
'workflows.bioinformatics',
'workflows.subgroup_discovery',
'workflows.nlp',
'workflows.ilp',
'workflows.mysql',
'website',
'signuplogin',
'django_extensions',
......@@ -199,6 +201,8 @@ else:
'workflows.bioinformatics',
'workflows.subgroup_discovery',
'workflows.nlp',
'workflows.ilp',
'workflows.mysql',
'workflows.base',
'website',
'signuplogin',
......
......@@ -17,6 +17,7 @@ class DBConnection:
class DBContext:
def __init__(self, connection):
self.connection = connection
cursor = connection.cursor()
cursor.execute('SHOW tables')
self.tables = [table for (table,) in cursor]
......@@ -32,6 +33,7 @@ class DBContext:
for (table, col, ref_table, ref_col) in cursor:
self.connected[(table, ref_table)] = (col, ref_col)
self.target_table = self.tables[0]
self.connection.close()
def update(self, postdata):
widget_id = postdata.get('widget_id')[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment