publishing_platform_sidekiq 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fcf5bc35df9a955e5f95c26b9beba405d7e0fe86ebdc9412b46f2124dae793f4
4
+ data.tar.gz: 3c8c9dab1a8b6bafca3f79ec08b28da5ce7fb6099c9a3a369f07356c9060788a
5
+ SHA512:
6
+ metadata.gz: 14d32123b087699d224dbc6eae378bb4131fc56a1d505fe15ff29bd39f680eddb00befac3f8c348c609a6c817983b42b65d1f63ff961b82fcc0cbd39d0147650
7
+ data.tar.gz: 82bb95945faa182b35ca4cc0c3322fcf433fc95130e829971114e537f2fa9820461201de86581c2f10e779bcd6965360e84e7d19afc3bef2f5cb6475b83caa4c
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Publishing Platform
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # Publishing Platform Sidekiq
2
+ Provides standard setup and behaviour for Sidekiq in publishing platform applications.
@@ -0,0 +1,12 @@
1
+ require "publishing_platform_sidekiq/sidekiq_initializer"
2
+
3
+ module PublishingPlatformSidekiq
4
+ class Railtie < Rails::Railtie
5
+ initializer "publishing_platform_sidekiq.initialize_sidekiq" do |app|
6
+ SidekiqInitializer.setup_sidekiq(
7
+ ENV.fetch("PUBLISHING_PLATFORM_APP_NAME", app.root.basename.to_s),
8
+ { url: ENV.fetch("REDIS_URL", "redis://127.0.0.1:6379") },
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ require "sidekiq"
2
+
3
+ module PublishingPlatformSidekiq
4
+ module SidekiqInitializer
5
+ def self.setup_sidekiq(publishing_platform_app_name, redis_config = {})
6
+ redis_config = redis_config.merge(
7
+ namespace: publishing_platform_app_name,
8
+ reconnect_attempts: 4,
9
+ reconnect_delay: 15,
10
+ reconnect_delay_max: 60,
11
+ )
12
+
13
+ Sidekiq.configure_server do |config|
14
+ config.logger = Sidekiq::Logger.new($stdout)
15
+ config.redis = redis_config
16
+ end
17
+
18
+ Sidekiq.configure_client do |config|
19
+ config.redis = redis_config
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PublishingPlatformSidekiq
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1 @@
1
+ require "publishing_platform_sidekiq/railtie" if defined?(Rails)
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: publishing_platform_sidekiq
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Publishing Platform
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: redis
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sidekiq
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '7.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '7.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: publishing_platform_rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - LICENSE
62
+ - README.md
63
+ - lib/publishing_platform_sidekiq.rb
64
+ - lib/publishing_platform_sidekiq/railtie.rb
65
+ - lib/publishing_platform_sidekiq/sidekiq_initializer.rb
66
+ - lib/publishing_platform_sidekiq/version.rb
67
+ homepage:
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '3.0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubygems_version: 3.3.7
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: Provides standard setup and behaviour for Sidekiq in Publishing Platform
90
+ applications.
91
+ test_files: []