This commit is contained in:
Mateusz779 2023-04-21 10:59:34 +02:00
parent 5af4a65501
commit cf2c40e5b4
3 changed files with 5 additions and 6 deletions

View File

@ -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
View File

@ -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 (

View File

@ -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: