Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
selwin committed Oct 30, 2024
1 parent c4adade commit a3e23f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion django_rq/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def test_action_stop_jobs(self):
self.assertEqual(len(canceled_job_registry), len(job_ids))

for job_id in job_ids:
self.assertIn(job_id, canceled_job_registry)
self.assertTrue(job_id in canceled_job_registry)

# def test_scheduler_jobs(self):
# # Override testing RQ_QUEUES
Expand Down
4 changes: 1 addition & 3 deletions django_rq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def get_jobs(
1. If job data is not present in Redis, discard the result
2. If `registry` argument is supplied, delete empty jobs from registry
"""
jobs = cast(
List[Optional[Job]], Job.fetch_many(job_ids, connection=queue.connection, serializer=queue.serializer)
)
jobs = Job.fetch_many(job_ids, connection=queue.connection, serializer=queue.serializer)
valid_jobs = []
for i, job in enumerate(jobs):
if job is None:
Expand Down
3 changes: 2 additions & 1 deletion django_rq/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ def worker_details(request, queue_index, key):
queue_index = int(queue_index)
queue = get_queue_by_index(queue_index)
worker = Worker.find_by_key(key, connection=queue.connection)
assert worker
# Convert microseconds to milliseconds
worker.total_working_time = worker.total_working_time / 1000 # type: ignore[assignment]
worker.total_working_time = worker.total_working_time / 1000

queue_names = ', '.join(worker.queue_names())

Expand Down

0 comments on commit a3e23f4

Please sign in to comment.