diff options
Diffstat (limited to 'lib/scheduler_job.rb')
-rw-r--r-- | lib/scheduler_job.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/scheduler_job.rb b/lib/scheduler_job.rb deleted file mode 100644 index ee6c4ed..0000000 --- a/lib/scheduler_job.rb +++ /dev/null @@ -1,22 +0,0 @@ -class SchedulerJob - @queue = :scheduler_task - - def self.perform(method, *args) - self.send(method, *args) - end - - # run scheduler job - def self.run(project_id) - @project = Project.find(project_id) - - # when always_build not checked, do not build project in schedule if project not updated - return if !@project.always_build && (@project.builds.last.sha == @project.last_ref_sha(@project.default_ref)) - - # always_build not checked and project updated, build it - # always_build checked and no matter project updated or not, build it - @build = @project.register_build(ref: @project.default_ref) - if @build and @build.id - Runner.new(Build.find(@build.id)).run - end - end -end |