wal 0.0.22 → 0.0.23
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 +10 -4
- data/lib/wal/replicator.rb +3 -0
- data/lib/wal/version.rb +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: 3a7144e35e8bfe1df54e18fa1e4b9c94e4bb6926ed0de011e0e4006ce08c44cd
         | 
| 4 | 
            +
              data.tar.gz: 21196f54b92390273288aac5fed7b5fdcd79842dda0d63cbb0cada583bca8cd3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 88be295b55c90871dc4aa8731e21c03fff1b890e59a3b9ec000276c5d0b2dad96660b1686328af6e208084fc5389f90c8925dbc27fb29de56e535063eaf20899
         | 
| 7 | 
            +
              data.tar.gz: a13bd85ed047f5b7bfcfe839bb0ff8643587ae6c6ca81ef4f56809a96e4daff6a6f7423c9eff3a715cfa72f27e84b99765f003b4d40b0eacabf0d73cc7311bbc
         | 
    
        data/exe/wal
    CHANGED
    
    | @@ -91,7 +91,10 @@ elsif cli["start"] | |
| 91 91 | 
             
                temporary = config["temporary"] || false
         | 
| 92 92 | 
             
                publications = config["publications"] || []
         | 
| 93 93 | 
             
                replicator_class = config["replicator"].presence&.constantize || Wal::Replicator
         | 
| 94 | 
            -
                 | 
| 94 | 
            +
                max_retries = config["retries"]&.to_i || (2**32 - 1)
         | 
| 95 | 
            +
                retries = 0
         | 
| 96 | 
            +
                backoff = config["retry_backoff"]&.to_f || 1
         | 
| 97 | 
            +
                backoff_expoent = config["retry_backoff_expoent"]&.to_f
         | 
| 95 98 |  | 
| 96 99 | 
             
                Thread.new(slot, watcher, temporary, publications) do |replication_slot, watcher, use_temporary_slot, publications|
         | 
| 97 100 | 
             
                  replication_slot = "#{replication_slot}_#{SecureRandom.alphanumeric(4)}" if use_temporary_slot
         | 
| @@ -103,10 +106,13 @@ elsif cli["start"] | |
| 103 106 | 
             
                  begin
         | 
| 104 107 | 
             
                    replicator.replicate_forever(watcher, publications:)
         | 
| 105 108 | 
             
                  rescue StandardError => err
         | 
| 106 | 
            -
                    if retries  | 
| 109 | 
            +
                    if retries < max_retries
         | 
| 107 110 | 
             
                      Wal.logger&.error("[#{replication_slot}] Error #{err}")
         | 
| 108 | 
            -
                      retries  | 
| 109 | 
            -
                       | 
| 111 | 
            +
                      retries += 1
         | 
| 112 | 
            +
                      backoff_time = backoff_expoent ? (backoff * retries) ** backoff_expoent : backoff
         | 
| 113 | 
            +
                      puts "Restarting #{replication_slot} in #{backoff_time.floor(2)}s..."
         | 
| 114 | 
            +
                      sleep backoff_time
         | 
| 115 | 
            +
                      puts "Restarting #{replication_slot}"
         | 
| 110 116 | 
             
                      retry
         | 
| 111 117 | 
             
                    end
         | 
| 112 118 | 
             
                    raise
         | 
    
        data/lib/wal/replicator.rb
    CHANGED
    
    
    
        data/lib/wal/version.rb
    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.23
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Rodrigo Navarro
         | 
| 8 8 | 
             
            bindir: exe
         | 
| 9 9 | 
             
            cert_chain: []
         | 
| 10 | 
            -
            date: 2025-10- | 
| 10 | 
            +
            date: 2025-10-29 00:00:00.000000000 Z
         | 
| 11 11 | 
             
            dependencies:
         | 
| 12 12 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 13 13 | 
             
              name: pg
         |