Skip to content
Snippets Groups Projects
Commit 0cae00d9 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

get the time math right

parent 84c4072e
No related branches found
No related tags found
1 merge request!73Automatically maintain leases
......@@ -211,7 +211,7 @@ def needs_lease_renew(min_lease_remaining, stat, now):
:return bool: ``True`` if the lease needs to be renewed, ``False``
otherwise.
"""
remaining = now - datetime.utcfromtimestamp(stat.lease_expiration)
remaining = datetime.utcfromtimestamp(stat.lease_expiration) - now
return remaining < min_lease_remaining
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment