legion-data 1.6.19 → 1.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65eb28ef61c57c2d1248fe3def497d54253c6f694bb7b5b237b635b382c93487
4
- data.tar.gz: 3da968d08c194c396029a0a1ccbf81a02afe390257bfca01aac8bc0d89c2169d
3
+ metadata.gz: 68c8710d74c2f470f06e8c669c539c4db12bc0ac25807775cc85beb4e972e3b7
4
+ data.tar.gz: 5234ddf1a5d57c52e2af42c5264256327c746d3adcdc3117f3d73e04e127a481
5
5
  SHA512:
6
- metadata.gz: fc7ebee421fa890537dd79fbf23280b8952b3d4145c553965678f7822a1229cc56c38ea812e36ec16b9d88f2d8af7de315507d51a5269c0f45dc43b31d136338
7
- data.tar.gz: 3a7f266c4a70f307b86e000d41c52a36ee4ad773071c99fce4d75d47d4ef349fa97497b0bc437df0f6b479f34a3994c9aceb753e58f44f966b31ecf2078d7aa4
6
+ metadata.gz: f514db438336d661316ee66b7171ad4955a755053642a15fce766f32d35bded7c815ea9cc2e9372cb1d831a29413d30e6a9f607955b725a0a959b155ba9bfc72
7
+ data.tar.gz: 660ed97282f052ba1ce6b7b20651f8a7cef8b7b792329cc07326f6edf9038cefa1242bbfbf6714623bd39b763f5afd7c908d223ec2331905d90bf9725fe7543e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.20] - 2026-04-03
6
+
7
+ ### Fixed
8
+ - Local SQLite now uses WAL journal mode, 30s busy_timeout, and synchronous=NORMAL to reduce write contention
9
+ - Local SQLite path resolved to `~/.legionio/` absolute path instead of using relative CWD
10
+
5
11
  ## [1.6.19] - 2026-04-02
6
12
 
7
13
  ### Changed
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'fileutils'
3
4
  require 'legion/logging/helper'
4
5
 
5
6
  require 'sequel'
@@ -17,6 +18,11 @@ module Legion
17
18
  return if @connected
18
19
 
19
20
  db_file = database || local_settings[:database] || 'legionio_local.db'
21
+ unless File.absolute_path?(db_file)
22
+ base_dir = File.expand_path('~/.legionio')
23
+ FileUtils.mkdir_p(base_dir)
24
+ db_file = File.join(base_dir, db_file)
25
+ end
20
26
  @db_path = db_file
21
27
 
22
28
  sqlite_defaults = Legion::Data::Connection::ADAPTER_DEFAULTS.fetch(:sqlite, {})
@@ -39,9 +45,12 @@ module Legion
39
45
  end
40
46
 
41
47
  @connection = ::Sequel.connect(opts)
48
+ @connection.run('PRAGMA journal_mode=WAL')
49
+ @connection.run('PRAGMA busy_timeout=30000')
50
+ @connection.run('PRAGMA synchronous=NORMAL')
42
51
  @connected = true
43
52
  run_migrations
44
- log.info "Legion::Data::Local connected to #{db_file}"
53
+ log.info "Legion::Data::Local connected to #{db_file} (WAL mode, 30s busy_timeout)"
45
54
  rescue StandardError => e
46
55
  handle_exception(e, level: :error, handled: false, operation: :local_setup, database: db_file)
47
56
  raise
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.6.19'
5
+ VERSION = '1.6.20'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.19
4
+ version: 1.6.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity