From 80aba6eb885fce449d3819299a286fb0cb70405f Mon Sep 17 00:00:00 2001 From: dcordz <17937472+dcordz@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:08:58 -0400 Subject: [PATCH] litestram - set busy timeout pragma on sqlite db --- config/database.yml | 3 +++ litestream/restore.sh | 0 2 files changed, 3 insertions(+) mode change 100644 => 100755 litestream/restore.sh diff --git a/config/database.yml b/config/database.yml index 76a85654..1e31447f 100644 --- a/config/database.yml +++ b/config/database.yml @@ -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" @@ -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 diff --git a/litestream/restore.sh b/litestream/restore.sh old mode 100644 new mode 100755