From cd5eead7d8c17b739b0eab555c809ab750c5645a Mon Sep 17 00:00:00 2001 From: gustavoh Date: Sat, 19 Jan 2019 23:36:39 -0800 Subject: [PATCH] Minor bug fix. --- CocoaDaemon.podspec | 2 +- CocoaDaemon/CocoaDaemon/Daemon.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CocoaDaemon.podspec b/CocoaDaemon.podspec index 00891af..f99de71 100644 --- a/CocoaDaemon.podspec +++ b/CocoaDaemon.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'CocoaDaemon' - s.version = '0.9.4' + s.version = '0.9.5' s.summary = 'Daemon Kit to manage background closures to be called each set period of time.' s.homepage = 'https://github.com/ideastouch/CocoaDaemon' s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/CocoaDaemon/CocoaDaemon/Daemon.swift b/CocoaDaemon/CocoaDaemon/Daemon.swift index ccd4b02..2efe3de 100644 --- a/CocoaDaemon/CocoaDaemon/Daemon.swift +++ b/CocoaDaemon/CocoaDaemon/Daemon.swift @@ -73,7 +73,7 @@ public class Daemon { if let value = active { block_dictionary[.Active] = value } if let value = seconds { - assert(value < 0, "Seconds can't be negative") + assert(value > 0, "Seconds can't be negative") block_dictionary[.Seconds] = value } self.queue_block_dictionary[name] = block_dictionary } } @@ -81,7 +81,7 @@ public class Daemon { Read class description in order to understand better "submmitBlock" method. */ public func submmitBlock(_ name:String, block:@escaping ((_ scheduleNext: @escaping ()->Void)->Void), active:Bool, seconds:Double) { - assert(seconds < 0, "Seconds can't be negative") + assert(seconds > 0, "Seconds can't be negative") let nameInUse = self.nameInUse(name) if nameInUse { self.updateBlock(name, active: active, seconds: seconds) }