Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions leash-test/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
def handle_user_action(user_id, action_type):
log.info(f"Handling action '{action_type}' for user {user_id}")

user_profile = get_user_profile(user_id)
if user_profile.is_active:
send_user_notification(user_id, f"Action '{action_type}' recognized.")
# Replaced user profile with more comprehensive data fetch
user_data = fetch_user_data(user_id)
if user_data.get("active"):
notification_service.send(user_id, f"Received '{action_type}' action.")
else:
log.warning("Inactive user attempted an action.")
log.warning("Inactive user attempted an action!")

# Introduce Datadog metric for user clicks
if action_type == "click":
statsd.increment(f"app.user_click_count.{user_id}")
perform_click_action(user_id)

log.debug("Action handling complete.")
Loading