procrastinator 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/procrastinator/queue_worker.rb +1 -1
- data/lib/procrastinator/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: f0509c58df91713253273b49ffe9bcb247877399
|
4
|
+
data.tar.gz: 7b74c00c0400fb5a2d29a2dd41ed35a5ec22e5a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3195a78dc76f9eacb7334f0f4fe2bb00d378e5179255a145ed0ef6956db34ecc50aed2dc54ca5f00d2497d2440d591f00ba559d617d4b538f253fa1d2c370e7b
|
7
|
+
data.tar.gz: a1bd2be7c63829e0e7f0d0d16ffc1be37fa9309a3abddc05fa8f7ab8dd6767d18e5d0868583aa1a1294b9cb935e729a1d78ea46f7a29837dd22a73df373fadab
|
@@ -44,7 +44,7 @@ module Procrastinator
|
|
44
44
|
def act
|
45
45
|
# shuffling and re-sorting to avoid worst case O(n^2) on quicksort
|
46
46
|
# when receiving already sorted data. Ideally, we'd use a better algo, but this will do for now
|
47
|
-
tasks = @persister.read_tasks(@name).shuffle.sort_by { |t| t[:run_at] }
|
47
|
+
tasks = @persister.read_tasks(@name).shuffle.sort_by { |t| t[:run_at] || 0 }
|
48
48
|
|
49
49
|
tasks.first(@max_tasks).each do |task_data|
|
50
50
|
if Time.now.to_i >= task_data[:run_at].to_i
|