Skip to content

Commit

Permalink
fix:flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Sep 20, 2024
1 parent c7c3992 commit 834f780
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions scheduler/rq_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion scheduler/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 834f780

Please sign in to comment.