Removed unneeded function last_notitification
This commit is contained in:
pare
aecb8abbad
commit
7e8bfbdb63
S'han modificat 1 arxius amb 0 adicions i 36 eliminacions
|
@ -20,42 +20,6 @@ def unescape(s):
|
|||
s = s.replace("'", "'")
|
||||
return s
|
||||
|
||||
def last_notification():
|
||||
|
||||
###################################################################
|
||||
# query status_created_at of last notification
|
||||
|
||||
try:
|
||||
|
||||
conn = None
|
||||
|
||||
conn = psycopg2.connect(database = chess_db, user = chess_db_user, password = "", host = "/var/run/postgresql", port = "5432")
|
||||
|
||||
cur = conn.cursor()
|
||||
|
||||
cur.execute("select status_created_at from botreplies order by status_created_at desc limit 1")
|
||||
|
||||
row = cur.fetchone()
|
||||
if row != None:
|
||||
last_posted = row[0]
|
||||
last_posted = last_posted.strftime("%d/%m/%Y, %H:%M:%S")
|
||||
else:
|
||||
last_posted = ""
|
||||
|
||||
cur.close()
|
||||
|
||||
return last_posted
|
||||
|
||||
except (Exception, psycopg2.DatabaseError) as error:
|
||||
|
||||
print(error)
|
||||
|
||||
finally:
|
||||
|
||||
if conn is not None:
|
||||
|
||||
conn.close()
|
||||
|
||||
def get_bot_id():
|
||||
|
||||
###################################################################################################################################
|
||||
|
|
Loading…
Referencia en una nova incidència