diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-13 11:10:47 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-13 11:10:47 +0000 |
commit | c616200f821be630d6238a00ff08a77a60aeebe2 (patch) | |
tree | 3b1df8fc6f640bad31b9cb7241fc5cfa3133a166 /lib | |
parent | 5843a43c16e007193f5e26522d1e7368a0bdb2d7 (diff) | |
parent | b78954c13d127d84fa1e10db83f51b23790aa526 (diff) | |
download | gitlab-ce-c616200f821be630d6238a00ff08a77a60aeebe2.tar.gz |
Merge branch '39032-improve-merge-ongoing-check-consistency' into 'master'
Make "merge ongoing" check more consistent
Closes #39032
See merge request gitlab-org/gitlab-ce!14825
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/sidekiq_status.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/sidekiq_status.rb b/lib/gitlab/sidekiq_status.rb index a0a2769cf9e..a1f689d94d9 100644 --- a/lib/gitlab/sidekiq_status.rb +++ b/lib/gitlab/sidekiq_status.rb @@ -51,6 +51,13 @@ module Gitlab self.num_running(job_ids).zero? end + # Returns true if the given job is running + # + # job_id - The Sidekiq job ID to check. + def self.running?(job_id) + num_running([job_id]) > 0 + end + # Returns the number of jobs that are running. # # job_ids - The Sidekiq job IDs to check. |