Skip to content

Commit

Permalink
resqueをsolid_queueで置き換え (#1894)
Browse files Browse the repository at this point in the history
* replace resque with solid_queue

* fix CI

* fix mission_control_jobs_path

* add migration files

* remove image from docker-compose.override.example.yml

* update annotations

* update db/schema.rb

* update package.json
  • Loading branch information
nabeta authored Aug 17, 2024
1 parent f6a52de commit 6ef6327
Show file tree
Hide file tree
Showing 23 changed files with 357 additions and 72 deletions.
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ gem "redis", "~> 4.0"
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
gem "tzinfo-data", platforms: %i[ windows jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
Expand All @@ -50,7 +50,7 @@ gem "image_processing", "~> 1.2"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
gem "debug", platforms: %i[ mri windows ]
end

group :development do
Expand Down Expand Up @@ -97,7 +97,8 @@ gem 'progress_bar'
gem 'rails_autolink'
gem 'faraday_middleware'
gem 'kramdown'
gem 'resque', require: 'resque/server'
gem 'solid_queue'
gem 'mission_control-jobs'
gem 'acts-as-taggable-on'
gem 'resync' # , github: 'nabeta/resync', branch: 'add-datetime'
gem 'pretender'
Expand Down
52 changes: 31 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ GEM
sxp (~> 2.0)
unicode-types (~> 1.8)
erubi (1.13.0)
et-orbi (1.2.11)
tzinfo
factory_bot (6.4.6)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
Expand Down Expand Up @@ -191,6 +193,9 @@ GEM
ffi (1.17.0-x86_64-linux-gnu)
friendly_id (5.5.1)
activerecord (>= 4.0.0)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
geocoder (1.8.3)
base64 (>= 0.1.0)
csv (>= 3.0.0)
Expand All @@ -211,6 +216,10 @@ GEM
image_processing (1.13.0)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.0.1)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.7.2)
irb (1.14.0)
rdoc (>= 4.0.0)
Expand Down Expand Up @@ -265,13 +274,15 @@ GEM
mime-types-data (3.2024.0806)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.25.0)
mono_logger (1.1.2)
minitest (5.25.1)
mission_control-jobs (0.3.1)
importmap-rails
irb (~> 1.13)
rails (>= 7.1)
stimulus-rails
turbo-rails
msgpack (1.7.2)
multi_json (1.15.0)
multipart-post (2.4.1)
mustermann (3.0.2)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
net-imap (0.4.14)
date
Expand Down Expand Up @@ -310,11 +321,9 @@ GEM
nio4r (~> 2.0)
pundit (2.3.2)
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
rack (2.2.9)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.7)
rack
rack-session (1.0.2)
Expand Down Expand Up @@ -379,8 +388,6 @@ GEM
rdoc (6.7.0)
psych (>= 4.0.0)
redis (4.8.1)
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.9.2)
reline (0.5.9)
io-console (~> 0.5)
Expand All @@ -389,11 +396,6 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
resque (2.6.0)
mono_logger (~> 1.0)
multi_json (~> 1.0)
redis-namespace (~> 1.6)
sinatra (>= 0.9.2)
resync (0.4.6)
mime-types (~> 3.0)
typesafe_enum (~> 0.1, >= 0.1.5)
Expand Down Expand Up @@ -452,13 +454,14 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (3.2.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.2.0)
tilt (~> 2.0)
sitemap_generator (6.3.0)
builder (~> 3.0)
solid_queue (0.5.0)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11.0)
railties (>= 7.1)
sprockets (3.7.3)
base64
concurrent-ruby (~> 1.0)
Expand All @@ -468,6 +471,8 @@ GEM
activesupport (>= 6.1)
sprockets (>= 3.0.0)
statesman (12.1.0)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.1)
strip_attributes (1.13.0)
activemodel (>= 3.0, < 8.0)
Expand All @@ -487,6 +492,10 @@ GEM
thor (1.3.1)
tilt (2.4.0)
timeout (0.4.1)
turbo-rails (2.0.6)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
typesafe_enum (0.3.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -558,6 +567,7 @@ DEPENDENCIES
kt-paperclip
library_stdnums
lisbn
mission_control-jobs
oai
parallel_tests
pg (~> 1.1)
Expand All @@ -572,7 +582,6 @@ DEPENDENCIES
rdf-turtle
rdf-vocab
redis (~> 4.0)
resque
resync
rspec-rails
rspec_junit_formatter
Expand All @@ -581,6 +590,7 @@ DEPENDENCIES
selenium-webdriver
simplecov
sitemap_generator
solid_queue
sprockets (~> 3.7)
sprockets-rails
statesman (~> 12.1)
Expand Down
2 changes: 1 addition & 1 deletion app/views/agent_import_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<li><%= link_to t('activerecord.models.agent_import_result'), agent_import_results_path(agent_import_file_id: @agent_import_file.id) -%></li>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<li><%= link_to 'Resque', resque_path %></li>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
<% end %>
Expand Down
4 changes: 1 addition & 3 deletions app/views/event_export_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
<ul>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<% if defined?(Resque) %>
<li><%= link_to 'Resque', resque_path %></li>
<% end %>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
</div>
2 changes: 1 addition & 1 deletion app/views/event_import_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<ul>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<li><%= link_to 'Resque', resque_path %></li>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
<% end %>
Expand Down
4 changes: 1 addition & 3 deletions app/views/page/configuration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@
<div class="config_box">
<ul>
<% if current_user.has_role?('Administrator') %>
<% if defined?(Resque::Server) %>
<li><%= link_to 'Resque', resque_path %></li>
<% end %>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<li><%= link_to t('page.system_information'), page_system_information_path %></li>
<% end %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/resource_export_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ul>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<li><%= link_to 'Resque', resque_path %></li>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
</div>
2 changes: 1 addition & 1 deletion app/views/resource_import_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<ul>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<li><%= link_to 'Resque', resque_path %></li>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_export_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ul>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<li><%= link_to 'Resque', resque_path %></li>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
</div>
2 changes: 1 addition & 1 deletion app/views/user_import_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<ul>
<li><%= back_to_index(flash[:page_info]) -%></li>
<% if current_user.has_role?('Administrator') %>
<li><%= link_to 'Resque', resque_path %></li>
<li><%= link_to 'Queue', mission_control_jobs_path %></li>
<% end %>
</ul>
<% end %>
Expand Down
6 changes: 3 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
# config.cache_store = :mem_cache_store

# Use a real queuing backend for Active Job (and separate queues per environment).
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "enju_leaf_production"
config.active_job.queue_adapter = :solid_queue
config.active_job.queue_name_prefix = "enju_leaf_production"

config.action_mailer.perform_caching = false

Expand All @@ -94,7 +94,7 @@
# ]
# Skip DNS rebinding protection for the default health check endpoint.
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
config.active_job.queue_adapter = :resque
config.active_job.queue_adapter = :solid_queue

config.hosts += ['web', '127.0.0.1']
end
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@
config.action_controller.raise_on_missing_callback_actions = true

config.active_job.queue_adapter = :inline
config.mission_control.jobs.adapters = [ :inline, :solid_queue ]
end
2 changes: 0 additions & 2 deletions config/initializers/resque.rb

This file was deleted.

2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Rails.application.routes.draw do
authenticate :user, lambda {|u| u.role.try(:name) == 'Administrator' } do
mount Resque::Server.new, at: "/resque", as: :resque
mount MissionControl::Jobs::Engine, at: "/jobs"
end
resources :manifestations
resources :items
Expand Down
18 changes: 18 additions & 0 deletions config/solid_queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# default: &default
# dispatchers:
# - polling_interval: 1
# batch_size: 500
# workers:
# - queues: "*"
# threads: 3
# processes: 1
# polling_interval: 0.1
#
# development:
# <<: *default
#
# test:
# <<: *default
#
# production:
# <<: *default
Loading

0 comments on commit 6ef6327

Please sign in to comment.