Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def app_with_scout(scout_config=None):
"""
Context manager that configures a Huey app with Scout installed.
"""
# Enable Scout by default in tests.
if scout_config is None:
scout_config = {}
scout_config.setdefault("monitor", True)
scout_config["core_agent_launch"] = False
huey = MemoryHuey(immediate=True)
@huey.task()
@huey.lock_task("hello")
def hello():
return "Hello World!"
@huey.task()
def retry_once():
if not retry_once._did_retry:
retry_once._did_retry = True
raise RetryTask()
return "Done."
retry_once._did_retry = False
@huey.task()