From 834f7800303a14ad2c691aeb2be2acdb219a14fe Mon Sep 17 00:00:00 2001 From: Daniel M Date: Fri, 20 Sep 2024 10:34:13 -0400 Subject: [PATCH] fix:flake8 --- scheduler/rq_classes.py | 17 ++++++++--------- scheduler/tools.py | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/scheduler/rq_classes.py b/scheduler/rq_classes.py index a14b926..e071725 100644 --- a/scheduler/rq_classes.py +++ b/scheduler/rq_classes.py @@ -61,10 +61,9 @@ def __eq__(self, other) -> bool: def is_scheduled_task(self) -> bool: return self.meta.get("scheduled_task_id", None) is not None - def is_execution_of(self, task: "ScheduledTask") -> bool: - return ( - self.meta.get("task_type", None) == task.TASK_TYPE and self.meta.get("scheduled_task_id", None) == task.id - ) + def is_execution_of(self, task: "ScheduledTask") -> bool: # noqa: F821 + return (self.meta.get("task_type", None) == task.TASK_TYPE + and self.meta.get("scheduled_task_id", None) == task.id) def stop_execution(self, connection: ConnectionType): send_stop_job_command(connection, self.id) @@ -92,11 +91,11 @@ def __str__(self): return f"{self.name}/{','.join(self.queue_names())}" def _start_scheduler( - self, - burst: bool = False, - logging_level: str = "INFO", - date_format: str = "%H:%M:%S", - log_format: str = "%(asctime)s %(message)s", + self, + burst: bool = False, + logging_level: str = "INFO", + date_format: str = "%H:%M:%S", + log_format: str = "%(asctime)s %(message)s", ) -> None: """Starts the scheduler process. This is specifically designed to be run by the worker when running the `work()` method. diff --git a/scheduler/tools.py b/scheduler/tools.py index f9f1d99..3f5eac9 100644 --- a/scheduler/tools.py +++ b/scheduler/tools.py @@ -29,7 +29,7 @@ def get_next_cron_time(cron_string) -> timezone.datetime: return next_itr -def get_scheduled_task(task_model: str, task_id: int) -> "BaseTask": +def get_scheduled_task(task_model: str, task_id: int) -> "BaseTask": # noqa: F821 if task_model not in MODEL_NAMES: raise ValueError(f"Job Model {task_model} does not exist, choices are {MODEL_NAMES}") model = apps.get_model(app_label="scheduler", model_name=task_model)