Skip to content

Commit 834f780

Browse files
committed
fix:flake8
1 parent c7c3992 commit 834f780

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

scheduler/rq_classes.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ def __eq__(self, other) -> bool:
6161
def is_scheduled_task(self) -> bool:
6262
return self.meta.get("scheduled_task_id", None) is not None
6363

64-
def is_execution_of(self, task: "ScheduledTask") -> bool:
65-
return (
66-
self.meta.get("task_type", None) == task.TASK_TYPE and self.meta.get("scheduled_task_id", None) == task.id
67-
)
64+
def is_execution_of(self, task: "ScheduledTask") -> bool: # noqa: F821
65+
return (self.meta.get("task_type", None) == task.TASK_TYPE
66+
and self.meta.get("scheduled_task_id", None) == task.id)
6867

6968
def stop_execution(self, connection: ConnectionType):
7069
send_stop_job_command(connection, self.id)
@@ -92,11 +91,11 @@ def __str__(self):
9291
return f"{self.name}/{','.join(self.queue_names())}"
9392

9493
def _start_scheduler(
95-
self,
96-
burst: bool = False,
97-
logging_level: str = "INFO",
98-
date_format: str = "%H:%M:%S",
99-
log_format: str = "%(asctime)s %(message)s",
94+
self,
95+
burst: bool = False,
96+
logging_level: str = "INFO",
97+
date_format: str = "%H:%M:%S",
98+
log_format: str = "%(asctime)s %(message)s",
10099
) -> None:
101100
"""Starts the scheduler process.
102101
This is specifically designed to be run by the worker when running the `work()` method.

scheduler/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_next_cron_time(cron_string) -> timezone.datetime:
2929
return next_itr
3030

3131

32-
def get_scheduled_task(task_model: str, task_id: int) -> "BaseTask":
32+
def get_scheduled_task(task_model: str, task_id: int) -> "BaseTask": # noqa: F821
3333
if task_model not in MODEL_NAMES:
3434
raise ValueError(f"Job Model {task_model} does not exist, choices are {MODEL_NAMES}")
3535
model = apps.get_model(app_label="scheduler", model_name=task_model)

0 commit comments

Comments
 (0)