wal 0.0.4 → 0.0.6

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/wal +6 -4
  3. data/lib/wal/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ae004595b321331dd26bb5fa7942bdc18d28d75aa79647d2d861352d94ab945
4
- data.tar.gz: f7b2e1cf46055f9133b1aede3661774884a55780f5a430ed8d0be28fc45db642
3
+ metadata.gz: 45034aa6d8fa0824843be7e7940e8e85e4363ca80c58cb0838c92774d46f37c7
4
+ data.tar.gz: 721a2121845c5eee3cb3f5751a439bfff28a6d54eebc8c12117090aee068c453
5
5
  SHA512:
6
- metadata.gz: 42029a4c1ca4138c3e751667a62a19e3b08676c991940bad40caa7d1194fd4f8aa08161733ec860cca43a45745c68cf5f41371211f96c27b46b1e04ca672d1e2
7
- data.tar.gz: f3b0c235c66b612c9772bd8c89d7beed90ab44875884be2af127f9e0cea147bde920903bacef74b7fca3a762b3c792eb97573998ec80a64d56d50d7e6e58cfaa
6
+ metadata.gz: fd3f30a1ff2e8bb18bdc39edd89659d939c944ff7acaefbd9545227b06e728b93432e84f37877321d5df2d8a4a8163613f3287b13ed4dae700dbfe145a18e4fc
7
+ data.tar.gz: 3a86e518afdd3256769fd65c428387be1148e9494867c087d4dd8e32b03f2b50fb7e6c32ecaa00de9caae805beaac2edf9c194485fe2ccc1f943a0a9c175bfc6
data/exe/wal CHANGED
@@ -9,7 +9,6 @@ begin
9
9
  (--slot <replication-slot> | --tmp-slot)
10
10
  [--publication=<publication>...]
11
11
  [--replicator <replicator-class>]
12
-
13
12
  wal start <config-file>
14
13
 
15
14
  Options:
@@ -34,18 +33,21 @@ if cli["watch"]
34
33
  use_temporary_slot = cli["--tmp-slot"] || false
35
34
  replication_slot = cli["--slot"]
36
35
  replication_slot = replication_slot.presence || "wal_watcher_#{SecureRandom.alphanumeric(4)}" if use_temporary_slot
37
- replicator = cli["--replicator"]&.constantize || Wal::Replicator
36
+ publications = cli["--publication"] || []
37
+ replicator = cli["--replicator"].presence&.constantize || Wal::Replicator
38
38
 
39
+ puts "Watcher started for #{replication_slot} slot (#{publications.join(", ")})"
39
40
  replicator
40
41
  .new(replication_slot:, use_temporary_slot:, db_config:)
41
- .replicate_forever(watcher, publications: cli["--publication"])
42
+ .replicate_forever(watcher, publications:)
43
+ puts "Watcher finished for #{replication_slot}"
42
44
 
43
45
  elsif cli["start"]
44
46
  workers = YAML.load_file(cli["<config-file>"])["slots"].map do |slot, config|
45
47
  watcher = config["watcher"].constantize.new
46
48
  temporary = config["temporary"] || false
47
49
  publications = config["publications"] || []
48
- replicator = config["replicator"]&.constantize || Wal::Replicator
50
+ replicator = config["--replicator"].presence&.constantize || Wal::Replicator
49
51
 
50
52
  Thread.new(slot, watcher, temporary, publications) do |replication_slot, watcher, use_temporary_slot, publications|
51
53
  replication_slot = "#{replication_slot}_#{SecureRandom.alphanumeric(4)}" if use_temporary_slot
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.4"
4
+ VERSION = "0.0.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Navarro