Skip to content

Commit 7725a5b

Browse files
committed
add sleep after runtim start
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
1 parent 6a0cc8b commit 7725a5b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

dapr_agents/agents/durableagent/agent.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ def model_post_init(self, __context: Any) -> None:
120120

121121
self.register_agentic_system()
122122

123-
# Start the runtime if it's not already running
124-
logger.info("Starting workflow runtime...")
125-
self.start_runtime()
126123

127124
async def run(self, input_data: Union[str, Dict[str, Any]]) -> Any:
128125
"""

dapr_agents/workflow/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import inspect
44
import json
55
import logging
6+
import time
67
import sys
78
import uuid
89
from datetime import datetime, timezone
@@ -516,6 +517,9 @@ def start_runtime(self):
516517
self.wf_runtime.start()
517518
self.wf_runtime_is_running = True
518519

520+
logger.info("Sleeping for 5 seconds to ensure runtime is started.")
521+
time.sleep(5)
522+
519523
# Sync database state with Dapr workflow status after runtime starts
520524
# This ensures our database reflects the actual state of resumed workflows
521525
self._sync_workflow_state_after_startup()

quickstarts/01-hello-world/03_durable_agent.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ async def main():
8686
print(f"Error starting service: {e}")
8787
finally:
8888
travel_planner.graceful_shutdown()
89-
finally:
90-
travel_planner.graceful_shutdown()
9189

9290

9391
if __name__ == "__main__":

0 commit comments

Comments
 (0)