one_off 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/one_off/executor_job.rb +3 -0
- data/lib/one_off/configuration.rb +7 -0
- data/lib/one_off/version.rb +1 -1
- data/lib/one_off.rb +12 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bde4be08a52dae7536b56e60deca097042376ffd49eb576a747c705cbd0f8143
|
4
|
+
data.tar.gz: 25acfbbae0600bb36fb7e9fab6082353b9e07374446bdb61dc84bbc5ef4ff5af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad69e724464077e399150996d7d1cd83fd8354c20eb706d2fb42b56e5694bff4d0076b1c2d4ed2106530809f3f445cd5d86d86c96f0e7bc6e401c22c4cbcd98
|
7
|
+
data.tar.gz: 4e10be2b45d060b0a3f72fb567206f42507459f27ebf443b38dca92d8e04fd536ed7ef34e2b6dcf22efb1e962387dc096f2914d765c2883789424872f9407282
|
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
module OneOff
|
4
4
|
class ExecutorJob < ApplicationJob
|
5
|
+
queue_as OneOff.config.executor_queue if OneOff.config.executor_queue
|
6
|
+
rescue_from StandardError, with: OneOff.config.executor_rescue_handler if OneOff.config.executor_rescue_handler
|
7
|
+
|
5
8
|
def perform(file)
|
6
9
|
require "#{Rails.root}/db/one_off/#{file.filename}"
|
7
10
|
Rails.logger.info "=== Starting one_off task #{file.task_name}"
|
data/lib/one_off/version.rb
CHANGED
data/lib/one_off.rb
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'one_off/engine'
|
4
|
+
require 'one_off/configuration'
|
4
5
|
require 'one_off/file'
|
5
6
|
|
6
7
|
module OneOff
|
7
|
-
|
8
|
+
class << self
|
9
|
+
def configuration
|
10
|
+
@configuration ||= OneOff::Configuration.new
|
11
|
+
end
|
12
|
+
|
13
|
+
alias config configuration
|
14
|
+
|
15
|
+
def configure
|
16
|
+
yield configuration
|
17
|
+
end
|
18
|
+
end
|
8
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: one_off
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamed Asghari
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/generators/one_off/USAGE
|
92
92
|
- lib/generators/one_off/one_off_generator.rb
|
93
93
|
- lib/one_off.rb
|
94
|
+
- lib/one_off/configuration.rb
|
94
95
|
- lib/one_off/engine.rb
|
95
96
|
- lib/one_off/environments.rb
|
96
97
|
- lib/one_off/file.rb
|