Skip to content

Commit

Permalink
weid docker container infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
newtondotcom committed Jan 4, 2024
1 parent b4db2dd commit 78c3da4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion worker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,26 @@ def callback(ch, method, properties, body):
local_file_path = "temp/"+file_name
download_file(file_name, local_file_path,file_bucket_name)

print("File downloaded: "+local_file_path)

#Process file
path_in = local_file_path
path_out = local_file_path.replace(".mp4","_out.mp4")

trat_video(path_in,path_out,emoji,lsilence)

print("File processed: "+path_out)

#Upload file to S3
file_key = path_out
upload_file(file_key.replace("temp/",""), file_key.replace("temp/",""),file_bucket_name)

print("File uploaded: "+file_key)

remove_file(file_bucket_name,file_name)

print("File removed: "+file_name)

#remove minia
#remove_file(file_bucket_name,file_name.replace(".mp4",".png"))

Expand All @@ -66,8 +75,8 @@ def callback(ch, method, properties, body):
ch.basic_ack(delivery_tag=method.delivery_tag)

clean_temp()

print(" Done")
#exit()

channel.basic_qos(prefetch_count=1)
channel.basic_consume(queue='task_queue', on_message_callback=callback)
Expand Down

0 comments on commit 78c3da4

Please sign in to comment.