Add sidekiq

This commit is contained in:
Joshua Coles 2023-10-01 14:31:52 +01:00
parent 3c55c64b3f
commit 285cf78d63
7 changed files with 36 additions and 2 deletions

View File

@ -74,3 +74,5 @@ end
gem "tailwindcss-rails", "~> 2.0"
gem "font-awesome-sass"
gem "httparty"
gem "sidekiq"

View File

@ -82,6 +82,7 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.3)
debug (1.8.0)
@ -177,6 +178,8 @@ GEM
rdoc (6.5.0)
psych (>= 4.0.0)
redis (4.8.1)
redis-client (0.17.0)
connection_pool
regexp_parser (2.8.1)
reline (0.3.8)
io-console (~> 0.5)
@ -188,6 +191,11 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sidekiq (7.1.4)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.14.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
@ -241,6 +249,7 @@ DEPENDENCIES
rails (~> 7.0.7, >= 7.0.7.2)
redis (~> 4.0)
selenium-webdriver
sidekiq
sprockets-rails
stimulus-rails
tailwindcss-rails (~> 2.0)

3
Procfile Normal file
View File

@ -0,0 +1,3 @@
css: bin/rails tailwindcss:watch
redis: /opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
sidekiq: bundle exec sidekiq -C config/sidekiq.yml

View File

@ -1,2 +0,0 @@
web: bin/rails server -p 3000
css: bin/rails tailwindcss:watch

View File

@ -11,6 +11,8 @@ module LectureAttendanceManager
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
config.active_job.queue_adapter = :sidekiq
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files

View File

@ -0,0 +1,7 @@
Sidekiq.configure_server do |config|
config.redis = { url: ENV['REDIS_URL'] }
end
Sidekiq.configure_client do |config|
config.redis = { url: ENV['REDIS_URL'] }
end

13
config/sidekiq.yml Normal file
View File

@ -0,0 +1,13 @@
---
:concurrency: 5
staging:
:concurrency: 10
production:
:concurrency: 20
:queues:
- default
- mailers
# These are the cron jobs
:scheduler:
:schedule: