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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 585203be626fab88b3799c54a970386cf8500995
4
- data.tar.gz: 25b86adaa256bd8e64559237689849a3e1051e19
3
+ metadata.gz: f0509c58df91713253273b49ffe9bcb247877399
4
+ data.tar.gz: 7b74c00c0400fb5a2d29a2dd41ed35a5ec22e5a1
5
5
  SHA512:
6
- metadata.gz: 758e964a9edf01df9ae7e5d845614384c81cf76f053ac7939a5822bb2ca80bb088d3023df58025ece12ddd2f9a040711e324c6e7b084be8f07c48f4800732e0f
7
- data.tar.gz: 0ade5c71cab428f01c0e8080e2fb5d8e867ab809b8c96c7cf81df8bd3fa36e390d066c7918a42bc4d7de6278b942264d3af1d9c2a7b1ab896fa8fff3cf27cd6d
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
@@ -1,3 +1,3 @@
1
1
  module Procrastinator
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procrastinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Miller