mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
if the remote instance does not respond to an attempt to refresh a user profile it is probably temporarily overwhelmed
we just received an activity from them so it doesn't make sense to flag the instance as dormant, here.
This commit is contained in:
parent
2c1efdeb68
commit
d4141bb044
1 changed files with 8 additions and 2 deletions
|
@ -401,7 +401,10 @@ def refresh_user_profile_task(user_id):
|
|||
actor_data = get_request(user.ap_profile_id, headers={'Accept': 'application/activity+json'})
|
||||
except requests.exceptions.ReadTimeout:
|
||||
time.sleep(randint(3, 10))
|
||||
actor_data = get_request(user.ap_profile_id, headers={'Accept': 'application/activity+json'})
|
||||
try:
|
||||
actor_data = get_request(user.ap_profile_id, headers={'Accept': 'application/activity+json'})
|
||||
except requests.exceptions.ReadTimeout:
|
||||
return
|
||||
if actor_data.status_code == 200:
|
||||
activity_json = actor_data.json()
|
||||
actor_data.close()
|
||||
|
@ -456,7 +459,10 @@ def refresh_community_profile_task(community_id):
|
|||
actor_data = get_request(community.ap_profile_id, headers={'Accept': 'application/activity+json'})
|
||||
except requests.exceptions.ReadTimeout:
|
||||
time.sleep(randint(3, 10))
|
||||
actor_data = get_request(community.ap_profile_id, headers={'Accept': 'application/activity+json'})
|
||||
try:
|
||||
actor_data = get_request(community.ap_profile_id, headers={'Accept': 'application/activity+json'})
|
||||
except Exception as e:
|
||||
return
|
||||
if actor_data.status_code == 200:
|
||||
activity_json = actor_data.json()
|
||||
actor_data.close()
|
||||
|
|
Loading…
Add table
Reference in a new issue