diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-05 10:47:20 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-06 17:46:59 +0300 |
commit | cb082ae291ba13120bfffeac5cd5a7c4532142ff (patch) | |
tree | 7037a59adc74801a6156c4b8f858e44ca28bb27c /lib | |
parent | 7b09a484f1ecc422ce14602d9ee15e5a59100264 (diff) |
Improve instantiate recursion in cron_parser.rb
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/cron_parser.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/ci/cron_parser.rb b/lib/gitlab/ci/cron_parser.rb index 59272dbeca5..a3cc350ef22 100644 --- a/lib/gitlab/ci/cron_parser.rb +++ b/lib/gitlab/ci/cron_parser.rb @@ -10,8 +10,8 @@ module Gitlab end def next_time_from(time) - cron_line = try_parse_cron(@cron, @cron_timezone) - cron_line.next_time(time).in_time_zone(Time.zone) if cron_line.present? + @cron_line ||= try_parse_cron(@cron, @cron_timezone) + @cron_line.next_time(time).in_time_zone(Time.zone) if @cron_line.present? end def cron_valid? |