Skip to content

Commit

Permalink
Remove oldest_job - could be useful to add it later
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava Skvortsov committed Nov 18, 2020
1 parent 0a8be3c commit bcdefe2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions arq_admin/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class QueueStats(NamedTuple):
name: str
oldest_job: Optional[datetime]
host: str
port: int
database: int
Expand Down Expand Up @@ -58,7 +57,6 @@ async def get_stats(self) -> QueueStats:
jobs = await self.get_jobs()
return QueueStats(
name=self.name,
oldest_job=min(job.enqueue_time for job in jobs) if jobs else None,
host=str(self.redis_settings.host),
port=self.redis_settings.port,
database=self.redis_settings.database,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ async def test_status_filter(all_jobs: List[Job]) -> None:
@pytest.mark.asyncio
async def test_stats(all_jobs: List[Job]) -> None:
queue = Queue.from_name(default_queue_name)
oldest_job = min([(await job.info()).enqueue_time for job in all_jobs]) # type: ignore # noqa: C407
assert await queue.get_stats() == QueueStats(
name=default_queue_name,
oldest_job=oldest_job,
host=settings.REDIS_SETTINGS.host,
port=settings.REDIS_SETTINGS.port,
database=settings.REDIS_SETTINGS.database,
Expand Down

0 comments on commit bcdefe2

Please sign in to comment.