mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 16:20:09 +09:00
Load WAL checkpointer outside Zeitwerk reload; harden fork stop
Keep the module under lib/rails_ext, use before_worker_boot, shorten the SQLite busy timeout under stop's join, and PASSIVE-checkpoint on exit for short-lived writers. Co-authored-by: Thomas Klemm <github@tklemm.eu>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Start a checkpoint contender in every non-test process. Puma and Resque pool
|
||||
# stop before fork and start again in the child so the flock is never inherited.
|
||||
# Loaded from lib/rails_ext (autoload_lib ignore list) so reloads do not orphan
|
||||
# the contender thread. Non-test processes start here; Puma/Resque stop before
|
||||
# fork and start again in the child.
|
||||
require Rails.root.join("lib/rails_ext/sqlite_wal_checkpoint")
|
||||
|
||||
Rails.application.config.after_initialize do
|
||||
SqliteWalCheckpoint.start unless Rails.env.test?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user