pgbus 0.7.6 → 0.7.7

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
  SHA256:
3
- metadata.gz: a28025e2b7af463cb6ff57d12e516d461b9b968ed7bb4eb4568be18d77ff2678
4
- data.tar.gz: fd39f5774df158b0cf06e85a6ef52f0114d649008f56b4736a782ce895baae0b
3
+ metadata.gz: af9ea5eec454c7ecd4ca32a368382851d96ff7790ef9eb0661877e98eac02a07
4
+ data.tar.gz: 9b8b0d754071dc641cacf3691340ef499da00f7485987538f4c67dacc7d8f1cc
5
5
  SHA512:
6
- metadata.gz: 19ced25de78f93ccbf307e2bdd72a5dbc46050657c6e394bc9e6a16d8665fa19bc2a29cebf2fcbda8c31eb07e07d94545322eec80c5d61915ddd6bfc924de105
7
- data.tar.gz: 9d8e2a9255ce011edf6bc2647fbd4d604db65b8fb2470c17735149599072f2824e510db4e97c4d241cdd4d6a9fef2ff7c23638738cd40de581ee56a07b783f6b
6
+ metadata.gz: 15058498b3ca28d3e882fa3e01358c55f7cdd78b3a17cdb02c59c047a7194565e157a3889fda99afadd1439cd50807fa1d19d6e07c6c24a61919406111d9592b
7
+ data.tar.gz: 7032ebd0693d0c6eb4276489587a57a16207f305b58f324c789da4e3c0bb9032b81fe9e1c1fcf5f1bac1d58fe50864a819c4ad896bc6d8fc06cc816c801a6ef3
@@ -107,12 +107,22 @@ module Pgbus
107
107
 
108
108
  def execute_job(job)
109
109
  if defined?(Rails) && Rails.respond_to?(:application) && Rails.application
110
- Rails.application.executor.wrap { job.perform_now }
110
+ wrapper = reloading? ? Rails.application.reloader : Rails.application.executor
111
+ wrapper.wrap { job.perform_now }
111
112
  else
112
113
  job.perform_now
113
114
  end
114
115
  end
115
116
 
117
+ def reloading?
118
+ app_config = Rails.application.config
119
+ if app_config.respond_to?(:enable_reloading)
120
+ app_config.enable_reloading
121
+ else
122
+ !app_config.cache_classes
123
+ end
124
+ end
125
+
116
126
  def monotonic_now
117
127
  ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
118
128
  end
data/lib/pgbus/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pgbus
4
- VERSION = "0.7.6"
4
+ VERSION = "0.7.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson