wal 0.0.28 → 0.0.29
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 +4 -4
- data/exe/wal +8 -0
- data/lib/wal/version.rb +1 -1
- data/rbi/wal.rbi +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7decfb78b8ccea001e781411dbcbbe939e9a7a30f29767a306e7c0c98107aba1
|
|
4
|
+
data.tar.gz: 976ec1815c1f379b966fcdd963e522644be2c7a5623939dc839e17673970a71f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b8b9af4f0936ee756aeb492b3de17b68e17472af6d17ce05574c3bda747c28f1e73910490994a02d6f0255e59f2187d1e5e41927ddbdff39e113cc866950086
|
|
7
|
+
data.tar.gz: b0e185bf497f7dbc188eab4ef6935277a16e7a521c06a001b81374d68761954198852a7af1c68f51db5b126699b7f97666be66d8d7ea0ab14c95fd32a8120b95
|
data/exe/wal
CHANGED
|
@@ -89,6 +89,7 @@ def start_worker(db_config, slot, config)
|
|
|
89
89
|
temporary = config["temporary"] || false
|
|
90
90
|
publications = config["publications"] || []
|
|
91
91
|
replicator_class = config["replicator"].presence&.constantize || Wal::Replicator
|
|
92
|
+
auto_restart = config["auto_restart"].nil? || config["auto_restart"]
|
|
92
93
|
max_retries = config["retries"]&.to_i || (2**32 - 1)
|
|
93
94
|
retries = 0
|
|
94
95
|
backoff = config["retry_backoff"]&.to_f || 1
|
|
@@ -102,6 +103,13 @@ def start_worker(db_config, slot, config)
|
|
|
102
103
|
replicator = replicator_class.new(replication_slot:, use_temporary_slot:, db_config:)
|
|
103
104
|
replicator = Wal::LoggingReplicator.new(replication_slot, replicator)
|
|
104
105
|
replicator.replicate_forever(watcher, publications:)
|
|
106
|
+
if auto_restart
|
|
107
|
+
backoff_time = backoff_expoent ? (backoff * retries) ** backoff_expoent : backoff
|
|
108
|
+
puts "Watcher finished for #{replication_slot}, auto restarting in #{backoff_time.floor(2)}..."
|
|
109
|
+
sleep backoff_time
|
|
110
|
+
puts "Restarting #{replication_slot}"
|
|
111
|
+
redo
|
|
112
|
+
end
|
|
105
113
|
rescue StandardError => err
|
|
106
114
|
if retries < max_retries
|
|
107
115
|
Wal.logger&.error("[#{replication_slot}] Error #{err}")
|
data/lib/wal/version.rb
CHANGED
data/rbi/wal.rbi
CHANGED
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.
|
|
4
|
+
version: 0.0.29
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rodrigo Navarro
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-01-
|
|
10
|
+
date: 2026-01-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: pg
|