OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
place 24 hour limit on interval for date alerts and reminders
ulferts3753de224ab5
diff --git a/app/workers/cron/quarter_hour_schedule_job.rb b/app/workers/cron/quarter_hour_schedule_job.rbindex dc9b7b93b13..015defc5adf 100644--- a/app/workers/cron/quarter_hour_schedule_job.rb+++ b/app/workers/cron/quarter_hour_schedule_job.rb@@ -69,7 +69,11 @@ module Cron::QuarterHourScheduleJob.firstif predecessor- predecessor.cron_at + 15.minutes+ # To ovoid the jobs spanning a very long time e.g after a longer downtime, the interval+ # is limited to a somewhat arbitrary 24 hours.+ # On the other hand the two jobs currently making use of this module have a time reference where+ # it would not make sense to send very old data (i.e. reminders or date alerts)+ [upper_boundary - 24.hours, predecessor.cron_at + 15.minutes].maxelseupper_boundaryenddiff --git a/spec/workers/notifications/schedule_reminder_mails_job_spec.rb b/spec/workers/notifications/schedule_reminder_mails_job_spec.rbindex 61ab0eb8704..ef9c908c19c 100644--- a/spec/workers/notifications/schedule_reminder_mails_job_spec.rb+++ b/spec/workers/notifications/schedule_reminder_mails_job_spec.rb@@ -116,5 +116,18 @@ RSpec.describe Notifications::ScheduleReminderMailsJob, type: :job dolet(:expected_upper_boundary) { job_cron_at }endend++ context "when there is a predecessor job with a cron_at more than 24 hours before" do+ let(:previous_job_cron_at) { job_cron_at - 25.hours }++ before do+ previous_job+ end++ it_behaves_like "schedules reminder mails" do+ let(:expected_lower_boundary) { job_cron_at - 24.hours }+ let(:expected_upper_boundary) { job_cron_at }+ end+ endendend