mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -08:00
Bugfix: sleep() imports in community/util
This commit is contained in:
parent
910ba06620
commit
92cda776fa
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
from random import randint
|
||||||
from typing import List
|
from typing import List
|
||||||
import requests
|
import requests
|
||||||
from PIL import Image, ImageOps
|
from PIL import Image, ImageOps
|
||||||
|
@ -44,7 +45,7 @@ def search_for_community(address: str):
|
||||||
webfinger_data = get_request(f"https://{server}/.well-known/webfinger",
|
webfinger_data = get_request(f"https://{server}/.well-known/webfinger",
|
||||||
params={'resource': f"acct:{address[1:]}"})
|
params={'resource': f"acct:{address[1:]}"})
|
||||||
except requests.exceptions.ReadTimeout:
|
except requests.exceptions.ReadTimeout:
|
||||||
time.sleep(randint(3, 10))
|
sleep(randint(3, 10))
|
||||||
try:
|
try:
|
||||||
webfinger_data = get_request(f"https://{server}/.well-known/webfinger",
|
webfinger_data = get_request(f"https://{server}/.well-known/webfinger",
|
||||||
params={'resource': f"acct:{address[1:]}"})
|
params={'resource': f"acct:{address[1:]}"})
|
||||||
|
|
Loading…
Add table
Reference in a new issue