forked from shaba/openuds
fixed ticket_store cleanup times
This commit is contained in:
parent
c8839ed2a5
commit
8e76c1d733
@ -157,7 +157,7 @@ class TicketStore(UUIDModel):
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
now = getSqlDatetime()
|
now = getSqlDatetime()
|
||||||
for v in TicketStore.objects.all():
|
for v in TicketStore.objects.all():
|
||||||
if now > v.stamp + timedelta(seconds=v.validity):
|
if now > v.stamp + timedelta(seconds=v.validity+600): # Delete only really old tickets. Avoid "revalidate" issues
|
||||||
v.delete()
|
v.delete()
|
||||||
cleanSince = now - datetime.timedelta(seconds=TicketStore.MAX_VALIDITY)
|
cleanSince = now - datetime.timedelta(seconds=TicketStore.MAX_VALIDITY)
|
||||||
TicketStore.objects.filter(stamp__lt=cleanSince).delete()
|
TicketStore.objects.filter(stamp__lt=cleanSince).delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user