set instance.start_trying_again if it has not been already

This commit is contained in:
rimu 2024-09-30 15:58:02 +13:00
parent 0771bc8386
commit c37a01fde4

View file

@ -765,6 +765,10 @@ def inbox_domain(inbox: str) -> str:
def awaken_dormant_instance(instance):
if instance and not instance.gone_forever:
if instance.dormant:
if instance.start_trying_again is None:
instance.start_trying_again = utcnow() + timedelta(seconds=instance.failures ** 4)
db.session.commit()
else:
if instance.start_trying_again < utcnow():
instance.dormant = False
db.session.commit()