Fix remote instance ping
This commit is contained in:
parent
7d0ec12253
commit
78c3764cc6
|
@ -862,8 +862,8 @@ CELERY_BEAT_SCHEDULE = {
|
|||
"schedule": crontab(day_of_week="1", minute="0", hour="2"),
|
||||
"options": {"expires": 60 * 60 * 24},
|
||||
},
|
||||
"federation.check_remote_instance_availability": {
|
||||
"task": "federation.check_remote_instance_availability",
|
||||
"federation.check_all_remote_instance_availability": {
|
||||
"task": "federation.check_all_remote_instance_availability",
|
||||
"schedule": crontab(
|
||||
**env.dict(
|
||||
"SCHEDULE_FEDERATION_CHECK_INTANCES_AVAILABILITY",
|
||||
|
|
|
@ -646,14 +646,17 @@ def check_single_remote_instance_availability(domain):
|
|||
)
|
||||
domain.reachable = False
|
||||
domain.save()
|
||||
return domain.reachable
|
||||
|
||||
if "version" in nodeinfo.keys():
|
||||
domain.reachable = True
|
||||
domain.last_successful_contact = datetime.datetime.now()
|
||||
domain.save()
|
||||
return domain.reachable
|
||||
else:
|
||||
logger.info(
|
||||
f"Domain {domain.name} is not reacheable at the moment. Setting domain as unreacheable."
|
||||
)
|
||||
domain.reachable = False
|
||||
domain.save()
|
||||
return domain.reachable
|
||||
|
|
Loading…
Reference in New Issue