Skip to content

Commit 3da9c18

Browse files
committed
feat: add sidekiq_job_retry option
1 parent 4805e1d commit 3da9c18

14 files changed

+55
-15
lines changed

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3"
21
services:
32
redis:
43
image: "redis/redis-stack:6.2.6-v10"

exe/miteru

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$LOAD_PATH.unshift("#{__dir__}/../lib")
55

6-
require 'miteru'
6+
require "miteru"
77

88
ARGV.unshift(Miteru::CLI::App.default_task) unless Miteru::CLI::App.all_tasks.key?(ARGV[0])
99
Miteru::CLI::App.start(ARGV)

lefthook.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ pre-commit:
55
run: bundle exec standardrb --fix {staged_files}
66
stage_fixed: true
77
actionlint:
8-
glob: ".github/workflows/*.yaml"
8+
root: ".github/workflows"
9+
glob: "*.{yaml,yml}"
910
run: actionlint

lib/miteru/commands/sidekiq.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class << self
1010
def included(thor)
1111
thor.class_eval do
1212
desc "sidekiq", "Start Sidekiq"
13-
method_option :env, type: :string, default: "production", desc: "Environment"
13+
method_option :env, type: :string, default: "production", desc: "Environment", aliases: "-e"
1414
method_option :concurrency, type: :numeric, default: 5, desc: "Sidekiq concurrency", aliases: "-c"
1515
def sidekiq
1616
require "sidekiq/cli"

lib/miteru/config.rb

+41-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ class Config < Anyway::Config
1414
download_to: "/tmp",
1515
file_max_size: 1024 * 1024 * 100,
1616
file_extensions: [".zip", ".rar", ".7z", ".tar", ".gz"],
17-
file_mime_types: ["application/zip", "application/vnd.rar", "application/x-7z-compressed", "application/x-tar",
18-
"application/gzip"],
17+
file_mime_types: [
18+
"application/zip",
19+
"application/vnd.rar",
20+
"application/x-7z-compressed",
21+
"application/x-tar",
22+
"application/gzip"
23+
],
1924
api_timeout: 60,
2025
http_timeout: 60,
2126
download_timeout: 60,
2227
sentry_dsn: nil,
2328
sentry_trace_sample_rate: 0.25,
2429
sidekiq_redis_url: nil,
30+
sidekiq_job_retry: 0,
2531
cache_redis_url: nil,
2632
cache_ex: nil,
2733
cache_prefix: "miteru:cache",
@@ -44,6 +50,39 @@ class Config < Anyway::Config
4450
# @!attribute [r] sidekiq_redis_url
4551
# @return [String, nil]
4652

53+
# @!attribute [r] sidekiq_job_retry
54+
# @return [Integer]
55+
56+
# @!attribute [r] cache_redis_url
57+
# @return [String, nil]
58+
59+
# @!attribute [r] cache_ex
60+
# @return [Integer, nil]
61+
62+
# @!attribute [r] cache_prefix
63+
# @return [String]
64+
65+
# @!attribute [r] http_timeout
66+
# @return [Integer]
67+
68+
# @!attribute [r] api_timeout
69+
# @return [Integer]
70+
71+
# @!attribute [r] download_timeout
72+
# @return [Integer]
73+
74+
# @!attribute [rw] auto_download
75+
# @return [Boolean]
76+
77+
# @!attribute [rw] directory_traveling
78+
# @return [Boolean]
79+
80+
# @!attribute [rw] download_to
81+
# @return [String]
82+
83+
# @!attribute [rw] threads
84+
# @return [Integer]
85+
4786
# @!attribute [r] cache_redis_url
4887
# @return [String, nil]
4988

lib/miteru/feeds/ayashige.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Miteru
44
class Feeds
55
class Ayashige < Base
66
def initialize(base_url = "https://ayashige.herokuapp.com")
7-
super(base_url)
7+
super
88
end
99

1010
def urls

lib/miteru/feeds/phishing_database.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Miteru
44
class Feeds
55
class PhishingDatabase < Base
66
def initialize(base_url = "https://raw.githubusercontent.com")
7-
super(base_url)
7+
super
88
end
99

1010
def urls

lib/miteru/feeds/tweetfeed.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Miteru
44
class Feeds
55
class TweetFeed < Base
66
def initialize(base_url = "https://api.tweetfeed.live")
7-
super(base_url)
7+
super
88
end
99

1010
def urls

lib/miteru/feeds/urlscan.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class UrlScan < Base
77
# @param [String] base_url
88
#
99
def initialize(base_url = "https://urlscan.io")
10-
super(base_url)
10+
super
1111

1212
@headers = {"api-key": api_key}
1313
end

lib/miteru/feeds/urlscan_pro.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class UrlScanPro < Base
77
# @param [String] base_url
88
#
99
def initialize(base_url = "https://urlscan.io")
10-
super(base_url)
10+
super
1111

1212
@headers = {"api-key": api_key}
1313
end

lib/miteru/sidekiq/application.rb

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
Sidekiq.configure_server do |config|
88
config.redis = {url: Miteru.config.sidekiq_redis_url.to_s}
9+
config.default_job_options = {"retry" => Miteru.config.sidekiq_job_retry}
910
end
1011

1112
Sidekiq.configure_client do |config|

lib/miteru/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Miteru
4-
VERSION = "2.3.1"
4+
VERSION = "2.3.2"
55
end

miteru.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
3030
spec.add_development_dependency "coveralls_reborn", "~> 0.28"
3131
spec.add_development_dependency "fuubar", "~> 2.5.1"
3232
spec.add_development_dependency "mysql2", "~> 0.5.6"
33-
spec.add_development_dependency "pg", "~> 1.5.7"
33+
spec.add_development_dependency "pg", "~> 1.5.8"
3434
spec.add_development_dependency "rake", "~> 13.2.1"
3535
spec.add_development_dependency "rspec", "~> 3.13"
3636
spec.add_development_dependency "simplecov-lcov", "~> 0.8"
@@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
5656
spec.add_dependency "rack-session", "2.0.0"
5757
spec.add_dependency "rackup", "2.1.0"
5858
spec.add_dependency "redis", "5.3.0"
59-
spec.add_dependency "semantic_logger", "4.16.0"
59+
spec.add_dependency "semantic_logger", "4.16.1"
6060
spec.add_dependency "sentry-ruby", "5.19.0"
6161
spec.add_dependency "sentry-sidekiq", "5.19.0"
6262
spec.add_dependency "sidekiq", "7.3.2"

spec/orchestrator_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class DummyFeed < Miteru::Feeds::Base
44
def initialize(base_url = "http://example.com")
5-
super(base_url)
5+
super
66
end
77

88
def urls

0 commit comments

Comments
 (0)