Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-30 21:16:24 +0300
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-04-06 17:46:58 +0300
commit9573bb44bc94261814dbdbb384b9ad7acf2907ff (patch)
tree7f21ed207330cf4412be6a35f77ee0bf4c61f627 /lib
parentd48658e340c6d8d8b5e028afa6d5962ec7616e24 (diff)
real_next_run (WIP)
Diffstat (limited to 'lib')
-rw-r--r--lib/ci/cron_parser.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/ci/cron_parser.rb b/lib/ci/cron_parser.rb
index be41474198d..a569de293b3 100644
--- a/lib/ci/cron_parser.rb
+++ b/lib/ci/cron_parser.rb
@@ -1,5 +1,8 @@
module Ci
class CronParser
+ VALID_SYNTAX_SAMPLE_TIME_ZONE = 'UTC'
+ VALID_SYNTAX_SAMPLE_CRON = '* * * * *'
+
def initialize(cron, cron_time_zone = 'UTC')
@cron = cron
@cron_time_zone = cron_time_zone
@@ -12,10 +15,8 @@ module Ci
end
def validation
- VALID_SYNTAX_TIME_ZONE = 'Europe/Istanbul'
- VALID_SYNTAX_CRON = '* * * * *'
- is_valid_cron = try_parse_cron(@cron, VALID_SYNTAX_TIME_ZONE).present?
- is_valid_cron_time_zone = try_parse_cron(VALID_SYNTAX_CRON, @cron_time_zone).present?
+ is_valid_cron = try_parse_cron(@cron, VALID_SYNTAX_SAMPLE_TIME_ZONE).present?
+ is_valid_cron_time_zone = try_parse_cron(VALID_SYNTAX_SAMPLE_CRON, @cron_time_zone).present?
return is_valid_cron, is_valid_cron_time_zone
end