beweinreich commited on
Commit
9d5168a
2 Parent(s): 5ddaa3b e938c9d
Files changed (2) hide show
  1. tasks.py +1 -3
  2. tasks.py.orig +44 -0
tasks.py CHANGED
@@ -24,10 +24,8 @@ load_dotenv()
24
  # @app.task
25
  db_conn = get_connection()
26
  db_cursor = db_conn.cursor()
27
-
28
  def insert_result(run_key, mappings):
29
  for mapping in mappings:
30
  store_result_to_db(db_cursor, db_conn, run_key, mapping)
31
 
32
-
33
- # db_conn.close()
 
24
  # @app.task
25
  db_conn = get_connection()
26
  db_cursor = db_conn.cursor()
 
27
  def insert_result(run_key, mappings):
28
  for mapping in mappings:
29
  store_result_to_db(db_cursor, db_conn, run_key, mapping)
30
 
31
+ # db_conn.close()
 
tasks.py.orig ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # tasks.py
2
+ import os
3
+ import logging
4
+ from redis import Redis
5
+ from dotenv import load_dotenv
6
+ from celery import Celery
7
+ from db.db_utils import get_connection, store_result_to_db
8
+
9
+ load_dotenv()
10
+
11
+ # REDIS_URL = os.environ['REDIS_URL']
12
+ # app = Celery('tasks', broker=REDIS_URL, backend=REDIS_URL)
13
+
14
+ # app.conf.update(
15
+ # result_expires=3600,
16
+ # task_serializer='json',
17
+ # result_serializer='json',
18
+ # accept_content=['json'],
19
+ # timezone='UTC',
20
+ # enable_utc=True,
21
+ # broker_connection_retry_on_startup=True
22
+ # )
23
+ <<<<<<< HEAD
24
+
25
+ # @app.task
26
+ db_conn = get_connection()
27
+ db_cursor = db_conn.cursor()
28
+
29
+ =======
30
+
31
+ # @app.task
32
+ db_conn = get_connection()
33
+ db_cursor = db_conn.cursor()
34
+ >>>>>>> e938c9da41dfd18544b4ea8aa7107f56cf05b2f2
35
+ def insert_result(run_key, mappings):
36
+ for mapping in mappings:
37
+ store_result_to_db(db_cursor, db_conn, run_key, mapping)
38
+
39
+ <<<<<<< HEAD
40
+
41
+ # db_conn.close()
42
+ =======
43
+ # db_conn.close()
44
+ >>>>>>> e938c9da41dfd18544b4ea8aa7107f56cf05b2f2