day_planner 0.1.0.pre23 → 0.1.0.pre25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/day_planner/task.rb +1 -1
- data/lib/day_planner/base.rb +2 -1
- data/lib/day_planner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63f1c79cb1df54b1bc39d166848841670103023c
|
4
|
+
data.tar.gz: a39994b599e405bd5dfeeb1a8ffeb7867a169f74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0be1f6b1ec52b00d0e73bbdda73383a0ffd387c32a0cb1c43c8d7f0cc5c06c9c844651d2d9729c8c4e068d886dae5576a3300e65b69b05ddf6f413925fb8cf23
|
7
|
+
data.tar.gz: 01ad10a05026086b65726c8e1908f3e59fc528612ec26c533baf0c1386abb4b6f3c0719e8a980f683a35d42d3aca34dde60b31108cee9ac2f3ab48cb13d88fa9
|
@@ -23,7 +23,7 @@ module DayPlanner
|
|
23
23
|
|
24
24
|
def log(last, now)
|
25
25
|
if ActiveRecord::Base.connection.table_exists?('day_planner_log')
|
26
|
-
early = last + interval - now
|
26
|
+
early = last + interval.seconds - now
|
27
27
|
DayPlanner::Log.create(name: name, interval: interval, datetime: Time.now, early: early)
|
28
28
|
end
|
29
29
|
end
|
data/lib/day_planner/base.rb
CHANGED
@@ -111,6 +111,7 @@ module DayPlanner
|
|
111
111
|
@@tasks.select!{ |item| item.id != t.id }
|
112
112
|
else
|
113
113
|
if task.last_execution.nil? || task.next_execution.nil? || (time > task.next_execution && time > task.last_execution + (task.interval / 2))
|
114
|
+
last = task.last_execution
|
114
115
|
task.last_execution = time
|
115
116
|
|
116
117
|
if !task.next_execution.nil?
|
@@ -121,7 +122,7 @@ module DayPlanner
|
|
121
122
|
|
122
123
|
task.save!
|
123
124
|
|
124
|
-
t.log(
|
125
|
+
t.log(last, time)
|
125
126
|
t.block.call
|
126
127
|
end
|
127
128
|
end
|
data/lib/day_planner/version.rb
CHANGED