diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-05 01:54:45 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-06 23:46:59 +0900 |
commit | 4688eb47c6fe135fb9baad5a5d56b1dfa685cc7f (patch) | |
tree | 73ed8531a88ff7088ea419aa4518be02cd82f3ae /lib | |
parent | 1dbc888e3306f30ca0882aece86ccd1a817e0ab8 (diff) | |
download | gitlab-ce-4688eb47c6fe135fb9baad5a5d56b1dfa685cc7f.tar.gz |
Rename cron_time_zone to cron_timezone. Separate add_concurrent_foreign_key.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/cron_parser.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/ci/cron_parser.rb b/lib/gitlab/ci/cron_parser.rb index 69dd8ad0fce..d1877b76598 100644 --- a/lib/gitlab/ci/cron_parser.rb +++ b/lib/gitlab/ci/cron_parser.rb @@ -4,13 +4,13 @@ module Gitlab VALID_SYNTAX_SAMPLE_TIME_ZONE = 'UTC'.freeze VALID_SYNTAX_SAMPLE_CRON = '* * * * *'.freeze - def initialize(cron, cron_time_zone = 'UTC') + def initialize(cron, cron_timezone = 'UTC') @cron = cron - @cron_time_zone = cron_time_zone + @cron_timezone = cron_timezone end def next_time_from(time) - cron_line = try_parse_cron(@cron, @cron_time_zone) + cron_line = try_parse_cron(@cron, @cron_timezone) cron_line.next_time(time).in_time_zone(Time.zone) if cron_line.present? end @@ -18,14 +18,14 @@ module Gitlab try_parse_cron(@cron, VALID_SYNTAX_SAMPLE_TIME_ZONE).present? end - def cron_time_zone_valid? - try_parse_cron(VALID_SYNTAX_SAMPLE_CRON, @cron_time_zone).present? + def cron_timezone_valid? + try_parse_cron(VALID_SYNTAX_SAMPLE_CRON, @cron_timezone).present? end private - def try_parse_cron(cron, cron_time_zone) - Rufus::Scheduler.parse("#{cron} #{cron_time_zone}") + def try_parse_cron(cron, cron_timezone) + Rufus::Scheduler.parse("#{cron} #{cron_timezone}") rescue # noop end |