MCPcopy Create free account
hub / github.com/python-arq/arq / cli

Function cli

arq/cli.py:33–54  ·  view source on GitHub ↗

Job queues in python with asyncio and redis. CLI to run the arq worker.

(*, worker_settings: str, burst: bool, check: bool, watch: str, verbose: bool, custom_log_dict: str)

Source from the content-addressed store, hash-verified

31@click.option('-v', '--verbose', is_flag=True, help=verbose_help)
32@click.option('--custom-log-dict', type=str, help=logdict_help)
33def cli(*, worker_settings: str, burst: bool, check: bool, watch: str, verbose: bool, custom_log_dict: str) -> None:
34 """
35 Job queues in python with asyncio and redis.
36
37 CLI to run the arq worker.
38 """
39 sys.path.append(os.getcwd())
40 worker_settings_ = cast('WorkerSettingsType', import_string(worker_settings))
41 if custom_log_dict:
42 log_config = import_string(custom_log_dict)
43 else:
44 log_config = default_log_config(verbose)
45 logging.config.dictConfig(log_config)
46
47 if check:
48 exit(check_health(worker_settings_))
49 else:
50 kwargs = {} if burst is None else {'burst': burst}
51 if watch:
52 asyncio.run(watch_reload(watch, worker_settings_))
53 else:
54 run_worker(worker_settings_, **kwargs)
55
56
57async def watch_reload(path: str, worker_settings: 'WorkerSettingsType') -> None:

Callers 1

__main__.pyFile · 0.90

Calls 6

import_stringFunction · 0.85
default_log_configFunction · 0.85
check_healthFunction · 0.85
watch_reloadFunction · 0.85
run_workerFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected