summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-04-05 16:47:20 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-04-06 23:46:59 +0900
commitcb082ae291ba13120bfffeac5cd5a7c4532142ff (patch)
tree7037a59adc74801a6156c4b8f858e44ca28bb27c
parent7b09a484f1ecc422ce14602d9ee15e5a59100264 (diff)
downloadgitlab-ce-cb082ae291ba13120bfffeac5cd5a7c4532142ff.tar.gz
Improve instantiate recursion in cron_parser.rb
-rw-r--r--lib/gitlab/ci/cron_parser.rb4
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?