mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
retry get requests
This commit is contained in:
parent
41cc3de80d
commit
13edcd4e13
1 changed files with 5 additions and 1 deletions
|
@ -217,6 +217,10 @@ def find_actor_or_create(actor: str) -> Union[User, Community, None]:
|
|||
return user
|
||||
else: # User does not exist in the DB, it's going to need to be created from it's remote home instance
|
||||
if actor.startswith('https://'):
|
||||
try:
|
||||
actor_data = get_request(actor, headers={'Accept': 'application/activity+json'})
|
||||
except requests.exceptions.ReadTimeout:
|
||||
time.sleep(randint(3, 10))
|
||||
actor_data = get_request(actor, headers={'Accept': 'application/activity+json'})
|
||||
if actor_data.status_code == 200:
|
||||
actor_json = actor_data.json()
|
||||
|
|
Loading…
Add table
Reference in a new issue