Skip to content

Commit

Permalink
sort all_job_results
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Mar 6, 2019
1 parent d410c4b commit 183ce56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
History
-------

v0.16.0a1 (2010-03-06)
v0.16.0a2 (2010-03-06)
......................
* add ``job_try`` argument to ``enqueue_job``, #113
* adding ``--watch`` mode to the worker (requires ``watchgod``), #114
Expand Down
4 changes: 3 additions & 1 deletion arq/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pickle
from dataclasses import dataclass
from datetime import datetime, timedelta
from operator import itemgetter
from typing import Any, Dict, List, Optional, Union
from uuid import uuid4

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


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

0 comments on commit 183ce56

Please sign in to comment.