-
This commit is contained in:
parent
5af4a65501
commit
cf2c40e5b4
@ -4,5 +4,4 @@ user="praktyki"
|
||||
password="2a7driUITXFy73tO"
|
||||
port="5432"
|
||||
default_file = "default.squashfs"
|
||||
webssh_port = "8000"
|
||||
timezone = "UTC"
|
||||
webssh_port = "8000"
|
2
db.py
2
db.py
@ -19,7 +19,7 @@ def connect():
|
||||
cur = conn.cursor()
|
||||
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("SET TIMEZONE = %s", (config.timezone,))
|
||||
cur.execute("SET TIMEZONE = 'UTC';")
|
||||
conn.commit()
|
||||
cur.execute("""
|
||||
CREATE TABLE IF NOT EXISTS image (
|
||||
|
6
utils.py
6
utils.py
@ -64,10 +64,10 @@ class PingThread(threading.Thread):
|
||||
print(date)
|
||||
if date is None:
|
||||
return
|
||||
delta = datetime.datetime.now() - date
|
||||
print(datetime.datetime.now())
|
||||
delta = datetime.datetime.utcnow() - date
|
||||
print(datetime.datetime.utcnow())
|
||||
print(delta.total_seconds())
|
||||
if delta.total_seconds() < -30:
|
||||
if delta.total_seconds() > 30:
|
||||
db.del_image_allocation_id(self.Id)
|
||||
print("deleted")
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user