pique 0.1.2 → 0.1.3

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: 4958795a20d442b9476ed9efa6f607a32a547835f08a75e6962287e8f9fdcc35
4
- data.tar.gz: 88d1e31fc4029032469c27cd93839bff7249a8ec06000987ba8d353f5b307c3b
3
+ metadata.gz: 59376966d633971953d649531aa89bc22dcb451fbaa0465ed291ed14882c21a9
4
+ data.tar.gz: b25cbca10beac5fb0c9793b30203d36fc87b6f8403b99424cd67f5b2b2d737e2
5
5
  SHA512:
6
- metadata.gz: f719f343c663c1078dce8be8ff648f046d7b089652cb60ae410675b899f0514e33e6bd57d56942d7c5fbdfab665b858e0b95981f26cf2751cfbf0680ae364951
7
- data.tar.gz: 50890afd3ad35e9457b5512c82c14676d1a46b730eb118b9ac877fe878d1d2b825452c9c87e5f78b2e3a86056c2904f76f16dc8f5bfeec85e773370bc5b24b9e
6
+ metadata.gz: 02d09a5204a09078ea47617f30adbf0ac2149d3cc6bd6fc4b9b4a45a64afa9d49a2d76c322469b4b60f1220f8fa6fb96f7893234ce8a9cca9aead0c3367b95a0
7
+ data.tar.gz: 22533819d086a0f42799e9e17f451e35b17fe81bed9fe65c465bbff916931894a6889c69d7245885f769336320a8527ccd50813fc67f46a14d2fd98ad3f02c68
data/lib/pique/agent.rb CHANGED
@@ -22,8 +22,8 @@ class Pique::Agent
22
22
  logger.info "Pique Agent Started"
23
23
  end
24
24
 
25
- def ready?
26
- ENV['PIQUE_API_URL'].present? && running?
25
+ def can_run?
26
+ ENV['PIQUE_API_URL'].present?
27
27
  end
28
28
 
29
29
  def running?
@@ -5,8 +5,10 @@ class Pique::Sidekiq::ClientMiddleware
5
5
  include Sidekiq::ClientMiddleware
6
6
 
7
7
  def call(worker, job, queue, redis_pool)
8
- agent = Pique::Agent.run!
9
- agent.push(worker, job) if agent.ready?
8
+ if Pique::Agent.can_run?
9
+ agent = Pique::Agent.run!
10
+ agent.push(worker, job)
11
+ end
10
12
  yield
11
13
  end
12
14
  end
@@ -5,8 +5,12 @@ class Pique::Sidekiq::ServerMiddleware
5
5
  include Sidekiq::ServerMiddleware
6
6
 
7
7
  def call(worker, job, queue)
8
- agent = Pique::Agent.run!
9
- yield
10
- agent.push(worker, job) if agent.ready?
8
+ if Pique::Agent.can_run?
9
+ agent = Pique::Agent.run!
10
+ yield
11
+ agent.push(worker, job)
12
+ else
13
+ yield
14
+ end
11
15
  end
12
16
  end
data/lib/pique/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pique
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pique
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bilal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2024-07-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Pique is a Rails plugin that monitors your jobs.
14
14
  email: