diff options
author | Fabio Pitino <fpitino@gitlab.com> | 2019-05-07 08:14:34 +0100 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-05-07 08:14:34 +0100 |
commit | 0eac37efea8206981749f64c3aae668ce95f1926 (patch) | |
tree | 34b287af35682e19db655af9b98eab1b56f18b2c | |
parent | 961da8ed08b7dbafd8db5e61acade43ccf69dded (diff) | |
download | gitlab-ce-0eac37efea8206981749f64c3aae668ce95f1926.tar.gz |
Remove temporary workaround rescuing RuntimeError
-rw-r--r-- | lib/gitlab/ci/cron_parser.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/gitlab/ci/cron_parser.rb b/lib/gitlab/ci/cron_parser.rb index ae524654b7d..94f4a4e36c9 100644 --- a/lib/gitlab/ci/cron_parser.rb +++ b/lib/gitlab/ci/cron_parser.rb @@ -13,7 +13,7 @@ module Gitlab def next_time_from(time) @cron_line ||= try_parse_cron(@cron, @cron_timezone) - find_next_time(time) if @cron_line.present? + @cron_line.next_time(time).utc.in_time_zone(Time.zone) if @cron_line.present? end def cron_valid? @@ -49,14 +49,6 @@ module Gitlab def try_parse_cron(cron, cron_timezone) Fugit::Cron.parse("#{cron} #{cron_timezone}") end - - def find_next_time(time) - @cron_line.next_time(time).utc.in_time_zone(Time.zone) - rescue RuntimeError => error - raise error unless error.message =~ /too many loops/ - # Fugit::Cron raises a RuntimeError if :next_time does not find the next schedule - # given an invalid pattern - E.g. try_parse_cron('0 12 31 2 *') - end end end end |