diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-08-25 18:42:46 -0700 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-08-25 18:42:46 -0700 |
| commit | 046b28312704f3131e72dcd2dbdacc5264d4aa62 (patch) | |
| tree | a8c2b14a6e1db3b662fee2c79af70d9fcb643c2e /lib/ci/scheduler.rb | |
| parent | e449426a4e7d15cdd582d4f136add52cbfb5e04e (diff) | |
| download | gitlab-ce-046b28312704f3131e72dcd2dbdacc5264d4aa62.tar.gz | |
Groundwork for merging CI into CE
Diffstat (limited to 'lib/ci/scheduler.rb')
| -rw-r--r-- | lib/ci/scheduler.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ci/scheduler.rb b/lib/ci/scheduler.rb new file mode 100644 index 00000000000..ee0958f4be1 --- /dev/null +++ b/lib/ci/scheduler.rb @@ -0,0 +1,16 @@ +module Ci + class Scheduler + def perform + projects = Ci::Project.where(always_build: true).all + projects.each do |project| + last_commit = project.commits.last + next unless last_commit && last_commit.last_build + + interval = project.polling_interval + if (last_commit.last_build.created_at + interval.hours) < Time.now + last_commit.retry + end + end + end + end +end |
