thecore_background_jobs 2.0.9 → 2.1.2

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: d15f75061e005335d22fa8ccf45f60f342b881ec8834e27e5ce208159b103749
4
- data.tar.gz: 8212131f7a02e28606db02424306b2b119c3e250007914e7a32d70434e9d4fc1
3
+ metadata.gz: 9b7b14db32819d6fbb4deea6d0de7c5a9de96ee727196297127673c310f41453
4
+ data.tar.gz: 295c9eeb6f34f197719e306c395f144c17591d4f774f29f5cb3be3fb16d39c73
5
5
  SHA512:
6
- metadata.gz: e5d1f6f6e5a7082528e062f7d17eea9b147ba797402c5aa32fa0ae42974e3cace42b88270aec29deab5ea54286b0834e97b95729c6511ada3835402a20b29ee5
7
- data.tar.gz: db34286930fcd1c8ca701cf9695d82d203e97de64a10a361f2264a7e7aab36739ee87f89bc9c49f32eb1d01603e3fe05da8084db5e1c6ab12788a334acba1aa9
6
+ metadata.gz: d99d181758add212dadd5f1ba2ccc902bece1ec310882117d9d6b818d617c7be3622dfa3520e9bda630b190a4ebf90346eaae5c403b3b200b845aa29a81316da
7
+ data.tar.gz: 7c4754bf550a65304023b073f6731b280eddfc5e28b57ef1f40a771bf7dc9b9ecef09bc9916cd66a412d5cca7e3a3fa13e38ccf6cb72e5b3fc1dcd969ccf7fa9
@@ -1,5 +1,6 @@
1
1
  class DemoWorker
2
2
  include Sidekiq::Worker
3
+ sidekiq_options retry: false, queue: "#{ENV["COMPOSE_PROJECT_NAME"]}_default"
3
4
 
4
5
  def perform(*args)
5
6
  puts "Worker is working"
@@ -0,0 +1,10 @@
1
+ require 'sidekiq'
2
+
3
+ current_db = rand(1..15)
4
+
5
+ Sidekiq.configure_server do |config|
6
+ config.redis = { :namespace => "#{ENV['COMPOSE_PROJECT_NAME'] || 'notset'}", :url => "#{ENV['REDIS_URL']}/#{current_db}" }
7
+ end
8
+ Sidekiq.configure_client do |config|
9
+ config.redis = { :namespace => "#{ENV['COMPOSE_PROJECT_NAME'] || 'notset'}", :url => "#{ENV['REDIS_URL']}/#{current_db}" }
10
+ end
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
  require 'sidekiq/web'
3
+ require 'sidekiq-scheduler/web'
3
4
 
4
5
  # Allow any authenticated User with admin capability
5
6
  authenticate :user, lambda { |u| u.admin? } do
@@ -1,4 +1,5 @@
1
1
  require 'thecore_backend_commons'
2
+ require 'redis-namespace'
2
3
  require 'sidekiq'
3
4
  require "sidekiq-scheduler"
4
5
  require "sidekiq-failures"
@@ -6,4 +7,12 @@ require "thecore_background_jobs/engine"
6
7
 
7
8
  module ThecoreBackgroundJobs
8
9
  # Your code goes here...
10
+ def self.email_setup
11
+ delivery_options = { domain: Settings.ns(:smtp).domain, address: Settings.ns(:smtp).address, port: Settings.ns(:smtp).port.to_i, enable_starttls_auto: (Settings.ns(:smtp).enable_starttls_auto == "true")}
12
+ # Other Options
13
+ delivery_options.merge!({user_name: Settings.ns(:smtp).user_name}) unless Settings.ns(:smtp).user_name.blank?
14
+ delivery_options.merge!({password: Settings.ns(:smtp).password}) unless Settings.ns(:smtp).password.blank?
15
+ delivery_options.merge!({authentication: Settings.ns(:smtp).authentication}) unless Settings.ns(:smtp).authentication.blank?
16
+ delivery_options
17
+ end
9
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_background_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_backend_commons
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redis-namespace
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sidekiq
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -77,6 +91,7 @@ files:
77
91
  - README.md
78
92
  - Rakefile
79
93
  - app/workers/demo_worker.rb
94
+ - config/initializers/sidekiq-thecore.rb
80
95
  - config/routes.rb
81
96
  - lib/admin_constraint.rb
82
97
  - lib/tasks/thecore_background_jobs_tasks.rake