1268889a78
- Implement EloCalculator service for 2v2 Euchre matches - Create background job processing with GoodJob - Add single match entry form - Add CSV upload for batch match entry - Create player rankings view - Add database schema for matches and elo snapshots
22 lines
653 B
Ruby
22 lines
653 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "good_job"
|
|
|
|
# GoodJob configuration for Hanami
|
|
# Since GoodJob is primarily designed for Rails, we configure it directly
|
|
|
|
GoodJob.preserve_job_records = true
|
|
GoodJob.retry_on_unhandled_error = false
|
|
GoodJob.on_thread_error = ->(exception) { puts "GoodJob error: #{exception.message}" }
|
|
|
|
# Set execution mode based on environment
|
|
if ENV["GOOD_JOB_EXECUTION_MODE"]
|
|
GoodJob.execution_mode = ENV["GOOD_JOB_EXECUTION_MODE"].to_sym
|
|
elsif ENV["RACK_ENV"] == "test"
|
|
GoodJob.execution_mode = :inline
|
|
elsif ENV["RACK_ENV"] == "development"
|
|
GoodJob.execution_mode = :async
|
|
else
|
|
GoodJob.execution_mode = :external
|
|
end
|