Skip to content

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

Don't schedule if next_schedule_time is nil

Oliver Günther09303a7f399f
diff --git a/modules/meeting/app/workers/recurring_meetings/init_next_occurrence_job.rb b/modules/meeting/app/workers/recurring_meetings/init_next_occurrence_job.rb
index 021216671e2..670a8f7c456 100644
--- a/modules/meeting/app/workers/recurring_meetings/init_next_occurrence_job.rb
+++ b/modules/meeting/app/workers/recurring_meetings/init_next_occurrence_job.rb
@@ -55,11 +55,11 @@ module RecurringMeetings
return
end
- # Schedule the next occurrence, if not instantiated
- check_next_occurrence
-
# Schedule the next job
schedule_next_job
+
+ # Schedule the next occurrence, if not instantiated
+ check_next_occurrence
rescue StandardError => e
Rails.logger.error { "Error while initializing next occurrence for series ##{recurring_meeting}: #{e.message}" }
end
@@ -99,6 +99,9 @@ module RecurringMeetings
##
# Schedule when this job should be run the next time
def schedule_next_job
+ # Do not schedule if the series is ending
+ return if next_scheduled_time.nil?
+
self
.class
.set(wait_until: next_scheduled_time)