diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-01-15 11:01:45 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-01-15 11:01:45 +0100 |
commit | d4cc45dae40245cffe7a47edcec81090cd4c67b5 (patch) | |
tree | c49f5e8bb184782afa1988e1bffc52fb7f55d7ed /lib | |
parent | e24967ab658724af50b6695ea64277802f3ed40c (diff) | |
download | gitlab-ci-d4cc45dae40245cffe7a47edcec81090cd4c67b5.tar.gz |
Check if the last commit has a last build
This silences another cron error with duck tape.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/scheduler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scheduler.rb b/lib/scheduler.rb index 217a0a5..76a77f6 100644 --- a/lib/scheduler.rb +++ b/lib/scheduler.rb @@ -3,7 +3,7 @@ class Scheduler projects = Project.where(always_build: true).all projects.each do |project| last_commit = project.commits.last - next unless last_commit + next unless last_commit && last_commit.last_build interval = project.polling_interval if (last_commit.last_build.created_at + interval.hours) < Time.now |