Skip to content

Commit

Permalink
docconvert --in-place -c docconvert-config.json src/
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter9192 committed Feb 3, 2023
1 parent a5e18aa commit 1921954
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/bartender/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ def mix(config: Path) -> None:
Like a bartender mixes the cocktails,
the i-vresse bartender mixes aka runs queued jobs.
:param config: Path to config file.
:raises ValueError: When no usefull destination found in config file.
Args:
config: Path to config file.
Raises:
ValueError: When no usefull destination found in config file.
"""
validated_config = build_config(config)
configs: list[ArqSchedulerConfig] = []
Expand Down
19 changes: 12 additions & 7 deletions src/bartender/schedulers/arq.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class ArqSchedulerConfig(BaseModel):
def redis_settings(self) -> RedisSettings:
"""Settings for arq.
:returns: The settings based on redis_dsn.
Returns:
The settings based on redis_dsn.
"""
return RedisSettings.from_dsn(self.redis_dsn)

Expand All @@ -52,7 +53,8 @@ class ArqScheduler(AbstractScheduler):
def __init__(self, config: ArqSchedulerConfig) -> None:
"""Arq scheduler.
:param config: The config.
Args:
config: The config.
"""
self.config: ArqSchedulerConfig = config
self.connection: Optional[ArqRedis] = None
Expand Down Expand Up @@ -133,10 +135,12 @@ async def _exec( # noqa: WPS210
def arq_worker(config: ArqSchedulerConfig, burst: bool = False) -> Worker:
"""Worker that runs jobs submitted to arq queue.
:param config: The config.
Should be equal to the one used to submit job.
:param burst: Whether to stop the worker once all jobs have been run.
:return: A worker.
Args:
config: The config. Should be equal to the one used to submit job.
burst: Whether to stop the worker once all jobs have been run.
Returns:
A worker.
"""
functions = [_exec]
return Worker(
Expand All @@ -151,7 +155,8 @@ def arq_worker(config: ArqSchedulerConfig, burst: bool = False) -> Worker:
async def run_workers(configs: list[ArqSchedulerConfig]) -> None:
"""Run worker for each arq scheduler config.
:param configs: The configs.
Args:
configs: The configs.
"""
workers = [arq_worker(config) for config in configs]
await gather(*[worker.async_run() for worker in workers])

0 comments on commit 1921954

Please sign in to comment.