Fixed Hanged Removal of non os managed services

This commit is contained in:
Adolfo Gómez García 2020-09-30 14:05:27 +02:00
parent 1789aee1e7
commit 5355cc5a51

View File

@ -59,10 +59,11 @@ class HangedCleaner(Job):
withHangedServices = ServicePool.objects.annotate(
hanged = Count(
'userServices',
# Rewrited Filter for servicePool
filter=Q(userServices__state_date__lt=since_state, userServices__state=State.PREPARING) |
Q(userServices__state_date__lt=since_state, userServices__state=State.USABLE, userServices__os_state=State.PREPARING)
)
).exclude(hanged=0).exclude(osmanager=None).exclude(service__provider__maintenance_mode=True).filter(state=State.ACTIVE)
).exclude(hanged=0).exclude(service__provider__maintenance_mode=True).filter(state=State.ACTIVE)
# Type
servicePool: ServicePool