mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 16:20:09 +09:00
88acc4e026
Disable wal_autocheckpoint and run PASSIVE checkpoints from one elected writer process. Contenders start in console/rake (initializer), Puma workers (including WEB_CONCURRENCY=auto), and Resque children, with failover, capped error backoff, and tests for lock takeover. Co-authored-by: Thomas Klemm <github@tklemm.eu>
14 lines
299 B
Ruby
14 lines
299 B
Ruby
task "resque:setup" do
|
|
require_relative "../../config/environment"
|
|
end
|
|
|
|
task "resque:pool:setup" do
|
|
ActiveRecord::Base.connection.disconnect!
|
|
|
|
Resque::Pool.after_prefork do |job|
|
|
ActiveRecord::Base.establish_connection
|
|
Resque.redis.client.close
|
|
SqliteWalCheckpoint.start
|
|
end
|
|
end
|