You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c.execute(f'SELECT j.last_used_seq, r.ts FROM {DB_PREFIX}bot_jobs j, {DB_PREFIX}records r WHERE j.job_id = %s AND j.last_used_seq = r.seq;', (job_id,))
31
31
rec=c.fetchone()
32
32
ifrecisNone:
@@ -35,7 +35,7 @@ def _get_last_used_seq(job_id):
35
35
returnlast_used_seq, ts
36
36
37
37
def_get_current_max_seq():
38
-
withdb.cursor() asc:
38
+
withget_db_cursor() asc:
39
39
c.execute(f"SELECT seq, ts FROM {DB_PREFIX}records WHERE seq = (SELECT MAX(seq) FROM {DB_PREFIX}records);")
40
40
rec=c.fetchone()
41
41
ifrecisNone:
@@ -44,7 +44,7 @@ def _get_current_max_seq():
44
44
returnmax_seq, now_ts
45
45
46
46
def_save_current_max_seq(job_id, seq):
47
-
withdb.cursor() asc:
47
+
withget_db_cursor() asc:
48
48
c.execute(f"INSERT INTO {DB_PREFIX}bot_jobs (job_id, last_used_seq) VALUES (%s, %s) ON CONFLICT (job_id) DO UPDATE SET last_used_seq = %s;", (job_id, seq, seq))
0 commit comments