forked from rDrama/rDrama
master
parent
f4322680c1
commit
7677f0751f
|
@ -115,4 +115,8 @@ def upload_video(file):
|
||||||
finally:
|
finally:
|
||||||
remove(file_path)
|
remove(file_path)
|
||||||
|
|
||||||
return resp['link']
|
link = resp['link']
|
||||||
|
img = Image(text=link, deletehash=resp['deletehash'])
|
||||||
|
g.db.add(img)
|
||||||
|
|
||||||
|
return link
|
||||||
|
|
|
@ -538,6 +538,8 @@ def check_processing_thread(v, post, link, db):
|
||||||
headers = {"Authorization": f"Client-ID {IMGUR_KEY}"}
|
headers = {"Authorization": f"Client-ID {IMGUR_KEY}"}
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
# break on error to prevent zombie threads
|
||||||
|
try:
|
||||||
time.sleep(15)
|
time.sleep(15)
|
||||||
|
|
||||||
req = requests.get(f"https://api.imgur.com/3/image/{image_id}", headers=headers)
|
req = requests.get(f"https://api.imgur.com/3/image/{image_id}", headers=headers)
|
||||||
|
@ -556,6 +558,8 @@ def check_processing_thread(v, post, link, db):
|
||||||
|
|
||||||
db.commit()
|
db.commit()
|
||||||
break
|
break
|
||||||
|
except Exception:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
@app.post("/submit")
|
@app.post("/submit")
|
||||||
|
|
Loading…
Reference in New Issue