Skip to content

Commit 183ce56

Browse files
committed
sort all_job_results
1 parent d410c4b commit 183ce56

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
History
44
-------
55

6-
v0.16.0a1 (2010-03-06)
6+
v0.16.0a2 (2010-03-06)
77
......................
88
* add ``job_try`` argument to ``enqueue_job``, #113
99
* adding ``--watch`` mode to the worker (requires ``watchgod``), #114

arq/connections.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pickle
44
from dataclasses import dataclass
55
from datetime import datetime, timedelta
6+
from operator import itemgetter
67
from typing import Any, Dict, List, Optional, Union
78
from uuid import uuid4
89

@@ -114,7 +115,8 @@ async def all_job_results(self) -> List[Dict]:
114115
Get results for all jobs in redis.
115116
"""
116117
keys = await self.keys(result_key_prefix + '*')
117-
return await asyncio.gather(*[self._get_job_result(k) for k in keys])
118+
results = await asyncio.gather(*[self._get_job_result(k) for k in keys])
119+
return sorted(results, key=itemgetter('enqueue_time'))
118120

119121

120122
async def create_pool(settings: RedisSettings = None, *, _retry: int = 0) -> ArqRedis:

0 commit comments

Comments
 (0)