diff --git a/stix_shifter_modules/mysql/stix_transmission/api_client.py b/stix_shifter_modules/mysql/stix_transmission/api_client.py index 2adb8b7d8..d10c2a62e 100644 --- a/stix_shifter_modules/mysql/stix_transmission/api_client.py +++ b/stix_shifter_modules/mysql/stix_transmission/api_client.py @@ -22,7 +22,7 @@ async def ping_data_source(self): try: pool = await aiomysql.create_pool(host=self.host, port=self.port, user=self.user, password=self.password, - db=self.database) + db=self.database, connect_timeout=self.timeout) async with pool.acquire() as conn: async with conn.cursor() as cur: await cur.execute("SELECT 42;") @@ -47,7 +47,7 @@ async def run_search(self, query, start=0, rows=0): try: pool = await aiomysql.create_pool(host=self.host, port=self.port, user=self.user, password=self.password, - db=self.database) + db=self.database, connect_timeout=self.timeout) async with pool.acquire() as conn: async with conn.cursor() as cursor: column_query = "SHOW COLUMNS FROM %s" % self.table @@ -60,8 +60,9 @@ async def run_search(self, query, start=0, rows=0): # Uncomment to see data on newly populated table # query = "select * from {} limit 1".format(self.table) - await cursor.execute(query) - result_collection = await cursor.fetchall() + await cursor.execute(query) + result_collection = await cursor.fetchall() + results_list = [] row_count = int(rows)