Skip to content

Commit

Permalink
Fix notified user logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Jan 30, 2025
1 parent e9d63e8 commit 3b172b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ai_marketplace_monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def notify_users(
msgs = []
unnotified_items = []
for item in items:
if ("notify_user", item["id"]) not in cache or user not in cache.get(
if ("notify_user", item["id"]) in cache and user in cache.get(
("notify_user", item["id"]), ()
):
continue
Expand All @@ -336,6 +336,9 @@ def notify_users(
)
unnotified_items.append(item)

if not unnotified_items:
continue

title = f"Found {len(msgs)} new item from {item['marketplace']}: "
message = "\n\n".join(msgs)
self.logger.info(
Expand Down

0 comments on commit 3b172b2

Please sign in to comment.