-
Notifications
You must be signed in to change notification settings - Fork 6
issue#2173 fix query for selecting emails on the send date. #2186
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
Conversation
| 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'); |
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.
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.
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.
something like CAST(GETDATE() As DATE) for send_date...the other two dates can be null
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 is also (NOW())::date
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.
Won't this mean that an email will be sent from dev the day after we deploy to dev?
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.
yep...that's exactly what it would mean. and that's exactly what I want. :)
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.
Further, it means that we could force-run the scheduled job right after deployment and use it as a smoke test.
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 is also (NOW())::date
Mein SQL-foo ist scheiẞe.
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.
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()); |
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.
👍
No description provided.