Skip to content

Commit

Permalink
fix: dedup job infos closes #101
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed Nov 18, 2023
1 parent ac412a7 commit 6ccb7da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion saq/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,14 @@ async def info(
)
)
)
job_info = [job.to_dict() for job in deserialized_jobs if job is not None]
job_info = list(
{
job["key"]: job
for job in (
job.to_dict() for job in deserialized_jobs if job is not None
)
}.values()
)
else:
job_info = []

Expand Down
2 changes: 1 addition & 1 deletion saq/web/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def create_app(queues: list[Queue]) -> Application:
password = os.environ.get("AUTH_PASSWORD")

if password:
from aiohttp_basicauth import BasicAuthMiddleware # type: ignore[import-untyped]
from aiohttp_basicauth import BasicAuthMiddleware # type: ignore

user = os.environ.get("AUTH_USER", "admin")
middlewares.append(BasicAuthMiddleware(username=user, password=password))
Expand Down

0 comments on commit 6ccb7da

Please sign in to comment.