Skip to content

Commit

Permalink
✨ add group_id to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Mar 8, 2024
1 parent cfd1185 commit dcfb833
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions redis_events/redis_events/v1_0/redis_queue/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ async def handle_event(profile: Profile, event: EventWithMetadata):
LOGGER.debug(f"Sending message {payload} with topic {redis_topic}")

origin = profile.settings.get("default_label")
group_id = profile.settings.get("wallet.group_id")

metadata = {"time_ns": time.time_ns()}
metadata_wallet_id = {"x-wallet-id": wallet_id} if wallet_id else {}
metadata_group_id = {"group_id": group_id} if group_id else {}
metadata_origin = {"origin": origin} if origin else {}
metadata.update(metadata_wallet_id)
metadata.update(metadata_group_id)
metadata.update(metadata_origin)

outbound = str.encode(
Expand Down

0 comments on commit dcfb833

Please sign in to comment.