Skip to content

Commit

Permalink
add sleep after update function
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy committed Jan 18, 2024
1 parent 95e9311 commit f8fbe43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/substrapp/tasks/tasks_save_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pathlib
from tempfile import TemporaryDirectory
from typing import Any
import time

import structlog
from django.conf import settings
Expand Down Expand Up @@ -71,6 +72,7 @@ def on_success(self, retval: dict[str, Any], task_id: str, args: tuple, kwargs:
with get_orchestrator_client(channel_name) as client:
# TODO atomiticy
client.update_function(orc_function)
time.sleep(5)
client.update_function_status(
function_key=function_key, action=orchestrator.function_pb2.FUNCTION_ACTION_READY
)
Expand Down

0 comments on commit f8fbe43

Please sign in to comment.