Skip to content

Commit

Permalink
litestram - set busy timeout pragma on sqlite db
Browse files Browse the repository at this point in the history
  • Loading branch information
dcordz committed Jun 6, 2024
1 parent 1e6ef12 commit 80aba6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ default: &default
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
password: <%= ENV['SWAY_DATABASE_PASSWORD'] %>
username: sway
# time to wait (in milliseconds) to obtain a write lock before raising an exception
# https://www.sqlite.org/pragma.html#pragma_busy_timeout
timeout: 5000
pragmas: # https://fractaledmind.github.io/2023/09/07/enhancing-rails-sqlite-fine-tuning/
# level of database durability, 2 = "FULL" (sync on every write), other values include 1 = "NORMAL" (sync every 1000 written pages) and 0 = "NONE"
Expand All @@ -56,6 +58,7 @@ default: &default
# increase the local connection cache to 2000 pages
# https://www.sqlite.org/pragma.html#pragma_cache_size
cache_size: 2000
busy_timeout: 5000

development:
<<: *default
Expand Down
Empty file modified litestream/restore.sh
100644 → 100755
Empty file.

0 comments on commit 80aba6e

Please sign in to comment.