Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding even more logging #4176

Merged
merged 1 commit into from
Jul 13, 2023
Merged
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
3 changes: 3 additions & 0 deletions uber/tasks/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ def send_automated_emails():
for model, query_func in AutomatedEmailFixture.queries.items():
log.info("Sending automated emails for " + model.__name__)
automated_emails = automated_emails_by_model.get(model.__name__, [])
log.info("Found " + str(len(automated_emails)) + " emails for " + model.__name__)
for automated_email in automated_emails:
if automated_email.currently_sending:
log.info(automated_email.ident + " is marked as currently sending")
if automated_email.last_send_time:
if (datetime.now() - automated_email.last_send_time) < timedelta(hours=1):
# Looks like another thread is still running and hasn't timed out.
Expand All @@ -183,6 +185,7 @@ def send_automated_emails():
session.commit()
unapproved_count = 0

log.info("Loading instances for " + automated_email.ident)
model_instances = query_func(session)
log.info("Evaluating " + str(len(model_instances)) + " instances of " + model.__name__)
for model_instance in model_instances:
Expand Down
Loading