Commit 0c979fc1 by Kálmán Viktor

vm: fix lease seconds inaccuracy for intervals longer than a day

parent 21333f3b
...@@ -72,7 +72,7 @@ class Lease(Model): ...@@ -72,7 +72,7 @@ class Lease(Model):
@suspend_interval.setter @suspend_interval.setter
def suspend_interval(self, value): def suspend_interval(self, value):
self.suspend_interval_seconds = value.seconds self.suspend_interval_seconds = value.total_seconds()
@property @property
def delete_interval(self): def delete_interval(self):
...@@ -80,7 +80,7 @@ class Lease(Model): ...@@ -80,7 +80,7 @@ class Lease(Model):
@delete_interval.setter @delete_interval.setter
def delete_interval(self, value): def delete_interval(self, value):
self.delete_interval_seconds = value.seconds self.delete_interval_seconds = value.total_seconds()
def get_readable_suspend_time(self): def get_readable_suspend_time(self):
return timeuntil(datetime.utcnow() + self.suspend_interval, return timeuntil(datetime.utcnow() + self.suspend_interval,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment