diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-11-07 10:27:54 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-11-07 10:27:54 +0000 |
commit | b1fae097bdb54232ca56f11447ec895ea067c56c (patch) | |
tree | 8434e633d5d3a7ac432b2537a137322fe67bd0ea /lib | |
parent | cb72c3cad804f92624d37fbb4921195ae6aea35f (diff) | |
parent | a6701d46b5dfce75f677dc2de7b2e08bd8f0d274 (diff) | |
download | gitlab-ce-b1fae097bdb54232ca56f11447ec895ea067c56c.tar.gz |
Merge branch 'winh-delayed-jobs-dynamic-timer' into 'master'
Add dynamic timer to delayed jobs
See merge request gitlab-org/gitlab-ce!22382
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/status/build/scheduled.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/gitlab/ci/status/build/scheduled.rb b/lib/gitlab/ci/status/build/scheduled.rb index f443dbee120..b3452eae189 100644 --- a/lib/gitlab/ci/status/build/scheduled.rb +++ b/lib/gitlab/ci/status/build/scheduled.rb @@ -9,7 +9,7 @@ module Gitlab { image: 'illustrations/illustrations_scheduled-job_countdown.svg', size: 'svg-394', - title: _("This is a delayed to run in ") + " #{execute_in}", + title: _("This is a delayed job to run in %{remainingTime}"), content: _("This job will automatically run after it's timer finishes. " \ "Often they are used for incremental roll-out deploys " \ "to production environments. When unscheduled it converts " \ @@ -18,21 +18,12 @@ module Gitlab end def status_tooltip - "delayed manual action (#{execute_in})" + "delayed manual action (%{remainingTime})" end def self.matches?(build, user) build.scheduled? && build.scheduled_at end - - private - - include TimeHelper - - def execute_in - remaining_seconds = [0, subject.scheduled_at - Time.now].max - duration_in_numbers(remaining_seconds) - end end end end |