Merge branches 'master' and 'master' of https://github.com/Aevann1/Drama

remotes/1693045480750635534/spooky-22
Aevann1 2021-09-07 00:17:52 +02:00
commit b7614e7603
1 changed files with 5 additions and 0 deletions

View File

@ -534,10 +534,13 @@ IMGUR_KEY = environ.get("IMGUR_KEY", "").strip()
def check_processing_thread(v, post, link, db):
print("thread")
image_id = link.split('/')[-1].rstrip('.mp4')
headers = {"Authorization": f"Client-ID {IMGUR_KEY}"}
while True:
print("sex")
# break on error to prevent zombie threads
try:
time.sleep(15)
@ -896,6 +899,7 @@ def submit_post(v):
post_url = upload_video(file)
new_post.url = post_url
new_post.processing = True
print("starting new thread")
gevent.spawn(check_processing_thread, v.id, new_post, post_url, g.db)
except UploadException as e:
if request.headers.get("Authorization"):
@ -918,6 +922,7 @@ def submit_post(v):
post_url = upload_video(file)
new_post.url = post_url
new_post.processing = True
print("starting new thread")
gevent.spawn(check_processing_thread, v.id, new_post, post_url, g.db)
except UploadException as e:
if request.headers.get("Authorization"):