Commit cb082ae2 authored by Shinya Maeda's avatar Shinya Maeda

Improve instantiate recursion in cron_parser.rb

parent 7b09a484
......@@ -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?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment