Files
redux-scraper/app/jobs/application_job.rb
Dylan Knutson e89dca1fa4 Add RSpec-Sorbet integration and enhance type safety across the codebase
- Added `rspec-sorbet` gem to the Gemfile for improved type checking in tests.
- Updated various Ruby files to enforce strict typing with Sorbet, enhancing type safety.
- Refactored job classes and models to include type signatures, ensuring better type checking and documentation.
- Modified tests to utilize RSpec-Sorbet features, improving clarity and maintainability.

These changes aim to enhance the overall stability and maintainability of the codebase.
2025-01-01 21:10:54 +00:00

30 lines
678 B
Ruby

# typed: strict
class ApplicationJob < ActiveJob::Base
extend T::Sig
extend T::Helpers
abstract!
include GoodJob::ActiveJobExtensions::Concurrency
include HasColorLogger
retry_on(
StandardError,
wait: :polynomially_longer,
attempts: :unlimited,
) do |job, exception|
job.logger.error(
"error: #{exception.message}\n#{exception.backtrace.join("\n")}",
)
end
@ignore_signature_args = T.let([], T.nilable(T::Array[Symbol]))
sig { params(args: Symbol).returns(T::Array[Symbol]) }
def self.ignore_signature_args(*args)
@ignore_signature_args ||= []
@ignore_signature_args.concat(args)
@ignore_signature_args
end
end