wal 0.0.12 → 0.0.13

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: ccfbc3d72aa1155b3ebc567b8476186a9650cdd58d4ba6f8ae8d4fc051e9384e
4
- data.tar.gz: 8ff8fc14c8dc58c321dd5431e6f28dede4f5452fbd0a4f0cb0755c25d96d1b69
3
+ metadata.gz: edfabb02eb019e1831b90121434be496668526305dc7cf7fb37a6d870adfcebf
4
+ data.tar.gz: b57e3cdafe8271d100fa2d8b4b3043023dfc28d11217c15094887a8bb148b09f
5
5
  SHA512:
6
- metadata.gz: 1421db2a176b50c6d868454944a6b59cec9d9b24185ed2774c0e06cb9cb765578fd2f158676c750d9f21768b07db892041ed090b36dc7a4f761f1cc97722ea3b
7
- data.tar.gz: f8c9d67dd37c6733f079d3d5bbc536615024114a2de1f3da2e95c832c375547b6ec14736887be73db628831e590ac3377d0e73f3c2e54381306bb003e3d42863
6
+ metadata.gz: 723a809da119ab2d144fcf04862b790b33a14c45a961027613eaeaa7db245a4465d9a177ac130537ab24de7be2acc8449f120307efa8421b550142b2c3c47924
7
+ data.tar.gz: 152d8bf513c3a0913dcb054446dcf8cfe7cde4e0bd8603240f52df3966dd7ef9907e60c01e483a26d6543e6ece795dde7ab8200f6c9c675354a60407c849f07c
data/exe/wal CHANGED
@@ -70,18 +70,24 @@ elsif cli["start"]
70
70
 
71
71
  ping = Thread.new do
72
72
  loop do
73
- ActiveRecord::Base.connection.execute("SELECT pg_logical_emit_message(true, 'wal_ping', '{}')")
73
+ ActiveRecord::Base.connection_pool.with_connection do |conn|
74
+ conn.execute("SELECT pg_logical_emit_message(true, 'wal_ping', '{}')")
75
+ end
74
76
  sleep 20
75
77
  end
76
78
  end
77
79
 
78
80
  workers << ping
79
81
 
80
- Signal.trap("INT") do
82
+ stop_workers = proc do
81
83
  puts "Stopping WAL workers..."
82
84
  workers.each(&:kill)
83
85
  puts "WAL workers stopped"
86
+ exit 0
84
87
  end
85
88
 
89
+ Signal.trap("TERM", &stop_workers)
90
+ Signal.trap("INT", &stop_workers)
91
+
86
92
  workers.each(&:join)
87
93
  end
@@ -86,6 +86,9 @@ module Wal
86
86
  watch_conn.standby_status_update(write_lsn: lsn)
87
87
  end
88
88
 
89
+ in XLogData(lsn:, data: PG::Replication::PGOutput::Message(prefix: "wal_ping"))
90
+ watch_conn.standby_status_update(write_lsn: [watch_conn.last_confirmed_lsn, lsn].compact.max)
91
+
89
92
  in XLogData(data: PG::Replication::PGOutput::Message(prefix:, content:)) if watcher.valid_context_prefix? prefix
90
93
  begin
91
94
  context = JSON.parse(content).presence || {}
data/lib/wal/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wal
4
- VERSION = "0.0.12"
4
+ VERSION = "0.0.13"
5
5
  end
data/rbi/wal.rbi CHANGED
@@ -7,7 +7,7 @@ module Wal
7
7
  UpdateEvent,
8
8
  DeleteEvent,
9
9
  ) }
10
- VERSION = "0.0.12"
10
+ VERSION = "0.0.13"
11
11
 
12
12
  class BeginTransactionEvent < T::Struct
13
13
  prop :transaction_id, Integer, immutable: true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Navarro
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-09-09 00:00:00.000000000 Z
10
+ date: 2025-09-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: pg