litejob 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78cf5ea54febd08b520ed3d25c27ebbf3e83ec04653a52a351db0366dbf7d4bb
4
- data.tar.gz: 8bfcfd530be21fc277140f160568df112173d88b85bd89fbb7d6ef26d612599f
3
+ metadata.gz: 9235b916ceb5620f30e307e23adb1c3baf256625a3d3cedde1c2851faa9ed490
4
+ data.tar.gz: 553500fbb22d4ef729a6059277cb56738c87b671e4009ac9c3b7174293f7bfb8
5
5
  SHA512:
6
- metadata.gz: 84dc5fbc75d0ec788d6c2a2268cbf01232b7a4ca4ff01d2600348a25c2d2129ecae7d08d0bdf489039409cfa19a786da49981ac6ee21f2bc6407ddf427a5d688
7
- data.tar.gz: 03c820e84b226b479b9d2f5180541c788f691c11ecd32b78b304cb6b49293f85f19d02287818907bfe8385bc5ed5c5d30b5e2b34799d65b7e710d692bfdda653
6
+ metadata.gz: 86125548df029a4a0035314ff34f3a429394079d56b88075e7b05ec72a4975a9b7ee32ed130bef939cfe4edd6a6cbc02b46458e011df847fd942efbbdbd36562
7
+ data.tar.gz: 50f38790e97d1b19462a5926bd2a92fbcbc9485ccadf2c89a9c1f1effc4ccd566650bea57400793d3d11aec0390c647f81e04d2ead1963aa0889f9522918654a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2023-08-13
4
+
5
+ - Fix some bugs with Litejob::Server
6
+
3
7
  ## [0.2.0] - 2023-08-13
4
8
 
5
9
  - Initial release of usable code
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- litejob (0.2.0)
4
+ litejob (0.2.1)
5
5
  litequeue (>= 0.2.0)
6
6
  litescheduler (>= 0.2.1)
7
7
 
@@ -2,11 +2,14 @@
2
2
 
3
3
  require "litequeue"
4
4
  require "litescheduler"
5
+ require_relative "processor"
5
6
 
6
7
  module Litejob
7
8
  # Litejob::Server is responsible for popping job payloads from the SQLite queue.
8
9
  # :nocov:
9
10
  class Server
11
+ # TODO: make queues use [["default", 1]]
12
+ # TODO: make queue priorities optional
10
13
  def initialize(queues)
11
14
  @queue = Litequeue.instance
12
15
  @scheduler = Litescheduler.instance
@@ -26,7 +29,7 @@ module Litejob
26
29
  def pop(queue)
27
30
  result = @queue.pop(queue: queue)
28
31
 
29
- return result[0] if result.length == 1
32
+ return result unless result.is_a?(Array)
30
33
  return false if result.empty?
31
34
 
32
35
  result
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Litejob
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/litejob.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "litejob/version"
4
4
  require_relative "litejob/client"
5
+ require_relative "litejob/server"
5
6
 
6
7
  # Litejob is responsible for providing an interface to job classes
7
8
  module Litejob
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: litejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohamed Hassan