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