Skip to content
Snippets Groups Projects

Resolve "Run CI/CD pipelines on a schedule" - "Basic backend implementation"

8 files
+ 127
99
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -9,15 +9,13 @@ class ScheduledTrigger < ActiveRecord::Base
@@ -9,15 +9,13 @@ class ScheduledTrigger < ActiveRecord::Base
def schedule_next_run!
def schedule_next_run!
next_time = Ci::CronParser.new(cron, cron_time_zone).next_time_from_now
next_time = Ci::CronParser.new(cron, cron_time_zone).next_time_from_now
update(:next_run_at => next_time) if next_time.present?
if next_time.present?
end
update_attributes(next_run_at: next_time)
end
def valid_ref?
true #TODO:
end
end
def update_last_run!
def update_last_run!
update(:last_run_at => Time.now)
update_attributes(last_run_at: Time.now)
end
end
end
end
end
end
Loading