-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log event for new device alert job emails sent #10506
Conversation
changelog: Internal, Logging, Log event for new device alert job emails sent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憤馃従
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks / works good 馃憤
emails_sent | ||
end | ||
|
||
private | ||
|
||
def analytics | ||
@analytics ||= Analytics.new(user: AnonymousUser.new, request: nil, sp: nil, session: {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is logging across all users? or for each user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The job runs independently of users (can dispatch emails for multiple users).
This was copied from how it's done in AccountReset::GrantRequestsAndSendEmails
:
def analytics | |
@analytics ||= Analytics.new( | |
user: AnonymousUser.new, | |
request: nil, | |
sp: nil, | |
session: {}, | |
) | |
end |
馃洜 Summary of changes
Adds logging to the worker job responsible for sending emails in response to expired sign-in attempts.
Why?
馃摐 Testing Plan
Verify tests pass:
rspec spec/services/create_new_device_alert_spec.rb
Verify event logged in local development when job runs:
make watch_events
in parallel tomake run
make watch_events
with count of emails which were sent