diff --git a/kitchen_counter/conversion/management/commands/custom_runserver.py b/kitchen_counter/conversion/management/commands/custom_runserver.py index e5f5b3e..9925f3f 100755 --- a/kitchen_counter/conversion/management/commands/custom_runserver.py +++ b/kitchen_counter/conversion/management/commands/custom_runserver.py @@ -38,6 +38,7 @@ def background_execution(obj): def run_conversion(msg): body_dict = json.loads(msg.body) + msg.delete() translated_script = ScriptTranslations.objects.get(translation_id=body_dict["translation_id"]) object_key = "INPUT/" + (translated_script.script_link_id.script.name.split("/"))[-1] local_file_path = "/home/ubuntu/Conversion_Kitchen_Code/kitchen_counter/media/" + translated_script.script_link_id.script.name @@ -68,7 +69,6 @@ def run_conversion(msg): background_thread.start() background_thread.join() s3_client.delete_object(Bucket='conversion-kitchen', Key=object_key) - msg.delete() def run_audit(msg): @@ -79,6 +79,7 @@ def run_audit(msg): print("Hello World inside ") body_dict = json.loads(msg.body) + msg.delete() user = body_dict.get("user") s3_url = body_dict.get("s3-file-path") screenplay_name = body_dict.get("screenplay_name") @@ -142,7 +143,6 @@ def run_audit(msg): ), defaults={"status" : "SUCCESS"} ) - msg.delete()