lib/ruote/storage/base.rb in ruote-2.1.7 vs lib/ruote/storage/base.rb in ruote-2.1.8
- old
+ new
@@ -30,16 +30,10 @@
#
# Base methods for storage implementations.
#
module StorageBase
- def reserve (doc)
-
- #(delete(doc) != true)
- delete(doc).nil?
- end
-
#--
# configurations
#++
def get_configuration (key)
@@ -141,12 +135,12 @@
end
def put_schedule (flavour, owner_fei, s, msg)
at = if s.is_a?(Time) # at or every
- at
- elsif is_cron_string(s) # cron
+ s
+ elsif Ruote.is_cron_string(s) # cron
Rufus::CronLine.new(s).next_time(Time.now + 1)
else # at or every
Ruote.s_to_at(s)
end
at = at.utc
@@ -207,21 +201,9 @@
def filter_schedules (scheds, now)
now = Ruote.time_to_utc_s(now)
scheds.select { |sched| sched['at'] <= now }
- end
-
- # Waiting for a better implementation of it in rufus-scheduler 2.0.4
- #
- def is_cron_string (s)
-
- ss = s.split(' ')
-
- return false if ss.size < 5 || ss.size > 6
- return false if s.match(/\d{4}/)
-
- true
end
end
end