bizside 3.0.4 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bizside/resque.rb +36 -0
- data/lib/bizside/task_helper.rb +1 -1
- data/lib/bizside/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bed5030b1dc567a2beb20a3151742c2941f771dfd41032330237fe10fa9f5809
|
4
|
+
data.tar.gz: 156b93de4011537b4154ef5ec6b02a17be8496e401790f49a0732c765150ac0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 285b6c8cdce686e9e74cc7cb63e7dcdfa21ad9c1f158a0f19cb4bbc466fe36bb278a7beaed6493144462d12b0b2a06b0621d63451afb50ec9005b9c74666cd8e
|
7
|
+
data.tar.gz: 9d299d2eac9d221de0f0029436695ba206ae4d99f399b23585f62df72fb83a1971631a7b7addf784e9290ebf6e8b149fa7ad761b9b33894f354a73fde80417a6
|
data/lib/bizside/resque.rb
CHANGED
@@ -159,3 +159,39 @@ end
|
|
159
159
|
Resque::Failure::Multiple.configure do |multi|
|
160
160
|
multi.classes = [Resque::Failure::Redis, Resque::Failure::LogOutput, Resque::Failure::JobAuditLog]
|
161
161
|
end
|
162
|
+
|
163
|
+
# resque-scheduler
|
164
|
+
if defined? Resque::Scheduler
|
165
|
+
module Bizside
|
166
|
+
module ResqueScheduler
|
167
|
+
class FailureHandler
|
168
|
+
def self.on_enqueue_failure(payload, exception)
|
169
|
+
::Resque::Scheduler::FailureHandler.on_enqueue_failure(payload, exception)
|
170
|
+
|
171
|
+
return if Bizside.rails_env&.test?
|
172
|
+
|
173
|
+
::Bizside.logger.error [
|
174
|
+
"[FATAL] Resque::Scheduler",
|
175
|
+
"#{payload}",
|
176
|
+
"#{exception.class} #{exception.to_s}",
|
177
|
+
"#{Array(exception.backtrace).join("\n")}"
|
178
|
+
].join("\n")
|
179
|
+
|
180
|
+
@hostname ||= (`hostname`.chomp rescue '(unknown)')
|
181
|
+
info = {
|
182
|
+
time: Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z'),
|
183
|
+
add_on_name: Bizside.config.add_on_name,
|
184
|
+
server_address: @hostname,
|
185
|
+
class: payload['class'],
|
186
|
+
args: payload['args'].to_s,
|
187
|
+
exception: exception.class,
|
188
|
+
exception_message: exception.to_s,
|
189
|
+
exception_backtrace: Array(exception.backtrace)[0..10].join("\n") # Get only the top 10 because there are many traces.
|
190
|
+
}
|
191
|
+
::Bizside::Audit::JobLogger.logger.record(info)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
Resque::Scheduler.failure_handler = Bizside::ResqueScheduler::FailureHandler
|
197
|
+
end
|
data/lib/bizside/task_helper.rb
CHANGED
@@ -53,7 +53,7 @@ def self.rails_env
|
|
53
53
|
if ENV['RAILS_ENV'].to_s.empty?
|
54
54
|
unless ENV['BIZSIDE_ENV'].to_s.empty?
|
55
55
|
case ENV['BIZSIDE_ENV']
|
56
|
-
when 'production', 'staging'
|
56
|
+
when 'production', 'staging', 'education'
|
57
57
|
ret = ENV['RAILS_ENV'] = 'production'
|
58
58
|
else
|
59
59
|
ret = ENV['RAILS_ENV'] = ENV['BIZSIDE_ENV']
|
data/lib/bizside/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bizside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bizside-developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|