Skip to content

Commit

Permalink
storage append on non-empty msg list
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Sep 19, 2023
1 parent d9095f5 commit 069e731
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sharded_queue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def register(
)

for pipe in set([pipe for (pipe, _) in pipe_messages]):
await self.storage.append(pipe, *[
msgs = [
msg for msg in
[
self.serializer.serialize(request)
Expand All @@ -119,7 +119,9 @@ async def register(
]
if not if_not_exists
or not await self.storage.contains(pipe, msg)
])
]
if len(msgs):
await self.storage.append(pipe, *msgs)


@dataclass
Expand Down

0 comments on commit 069e731

Please sign in to comment.