Skip to content

Conversation

@borinquenkid
Copy link
Collaborator

No description provided.

Comment on lines 1093 to 1096
INSERT INTO feedback_requests
(id, creator_id, requestee_id, recipient_id, template_id, send_date, due_date, submit_date, status) -- requestee: Zach Brown, recipient: Michael Kimberlin
VALUES
('ab2da7fc-fac2-11eb-9a03-0242ac130004', '59b790d2-fabc-11eb-9a03-0242ac130003', '43ee8e79-b33d-44cd-b23c-e183894ebfef', '6207b3fd-042d-49aa-9e28-dcc04f537c2d' ,'18ef2032-c264-411e-a8e1-ddda9a714bae', '2024-04-10', '2024-04-11', null, 'pending');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to change this insertion so that the send date is always the current day? That way we always have a piece of test data that could be used to test the cron job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like CAST(GETDATE() As DATE) for send_date...the other two dates can be null

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also (NOW())::date

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this mean that an email will be sent from dev the day after we deploy to dev?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep...that's exactly what it would mean. and that's exactly what I want. :)

Copy link
Member

@mkimberlin mkimberlin Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further, it means that we could force-run the scheduled job right after deployment and use it as a smoke test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also (NOW())::date

Mein SQL-foo ist scheiẞe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okey dokey

LocalDate today = LocalDate.now();
List<FeedbackRequest> feedbackRequests = feedbackRequestRepository.findBySendDateBeforeAndStatusEqual(today, "pending");
List<FeedbackRequest> feedbackRequests = feedbackRequestRepository.findBySendDateNotAfterAndStatusEqual(today, "pending");
LOG.info("About to send emails: " + feedbackRequests.size());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mkimberlin mkimberlin merged commit da55ecf into develop Apr 10, 2024
@mkimberlin mkimberlin deleted the feature-2173/send-sheduled-emails-part4 branch April 10, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants