litestream 0.10.4-x86_64-linux → 0.11.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8bb4abd15ba3bcc3a74961499c585bb9dac195303062002d50c9d4286ac75ef
4
- data.tar.gz: bff6afcd2f427df10f4420fb2a64503eb66b273116ea027e90ca1bf46a3ebb66
3
+ metadata.gz: e3de613a9927b059c8d6ec3201503267a7448a2b6eb7b3bb46a4ad50d1a518e3
4
+ data.tar.gz: 3a6e6bf6831bf284221e22e580abb4522bb69935cfba8a1f9fde540ec5b81565
5
5
  SHA512:
6
- metadata.gz: 0b02adcf0f13b84eadad824add0b46ca609413b8f23398b9341e3c0cc1d8f9ba4ea7b451a391657e4f7cc9ec34249ed74eea9921a2f461c5a8f49f706b4bc963
7
- data.tar.gz: 56cd364f9b4351947324d4d783ce69f53cb2afc5e16da14a5194cd694b2f35dbf083227560d0e579411db507beaf5977d27d674a26b8d1f13b29ee11a3abf73b
6
+ metadata.gz: 0c6133db1f86c5a94a587fdfccacec7e9a9be44d177f2dae8a07dced2b47e70ae8d7f32ef326119e2a9fdc462c1bce585ade876b758cb3ec567aa0388a5f42a9
7
+ data.tar.gz: 13d5a38e79e9324c72f9435f21ebb6990e83b443983a8ff8957e2431adad91be2acf6cdfe5351ad45c7e649815a360ea73937425a28bb7c0f88d222d32d11520
@@ -0,0 +1,13 @@
1
+ require "active_job"
2
+
3
+ module Litestream
4
+ class VerificationJob < ActiveJob::Base
5
+ queue_as Litestream.queue
6
+
7
+ def perform
8
+ Litestream::Commands.databases.each do |db_hash|
9
+ Litestream.verify!(db_hash["path"])
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Litestream
2
- VERSION = "0.10.4"
2
+ VERSION = "0.11.0"
3
3
  end
data/lib/litestream.rb CHANGED
@@ -23,6 +23,7 @@ module Litestream
23
23
 
24
24
  mattr_writer :username
25
25
  mattr_writer :password
26
+ mattr_writer :queue
26
27
 
27
28
  class << self
28
29
  def verify!(database_path)
@@ -51,7 +52,7 @@ module Litestream
51
52
  # use method instead of attr_accessor to ensure
52
53
  # this works if variable set after Litestream is loaded
53
54
  def username
54
- @username ||= ENV["LITESTREAM_USERNAME"] || @@username
55
+ @username ||= ENV["LITESTREAM_USERNAME"] || @@username || "litestream"
55
56
  end
56
57
 
57
58
  # use method instead of attr_accessor to ensure
@@ -60,6 +61,10 @@ module Litestream
60
61
  @password ||= ENV["LITESTREAM_PASSWORD"] || @@password
61
62
  end
62
63
 
64
+ def queue
65
+ @queue ||= ENV["LITESTREAM_QUEUE"] || @@queue || "default"
66
+ end
67
+
63
68
  def replicate_process
64
69
  info = {}
65
70
  if !`which systemctl`.empty?
@@ -82,11 +87,11 @@ module Litestream
82
87
  pid, _name = value.strip.split(" ")
83
88
  info[:pid] = pid
84
89
  elsif line.start_with?("Active:")
85
- _key, value = line.split(":")
86
- value, _ago = value.split(";")
90
+ value, _ago = line.split(";")
87
91
  status, timestamp = value.split(" since ")
88
- info[:started] = DateTime.strptime(timestamp.strip, "%Y-%m-%d %H:%M:%S %Z")
89
- info[:status] = status.split("(").first.strip
92
+ info[:started] = DateTime.strptime(timestamp.strip, "%a %Y-%m-%d %H:%M:%S %Z")
93
+ status_match = status.match(%r{\((?<status>.*)\)})
94
+ info[:status] = status_match ? status_match[:status] : nil
90
95
  end
91
96
  end
92
97
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: litestream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.11.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Stephen Margheim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-21 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logfmt
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activejob
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rubyzip
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +109,7 @@ files:
95
109
  - app/controllers/litestream/application_controller.rb
96
110
  - app/controllers/litestream/processes_controller.rb
97
111
  - app/controllers/litestream/restorations_controller.rb
112
+ - app/jobs/litestream/verification_job.rb
98
113
  - app/views/layouts/litestream/_style.html
99
114
  - app/views/layouts/litestream/application.html.erb
100
115
  - app/views/litestream/processes/show.html.erb
@@ -134,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
149
  - !ruby/object:Gem::Version
135
150
  version: '0'
136
151
  requirements: []
137
- rubygems_version: 3.5.1
152
+ rubygems_version: 3.5.17
138
153
  signing_key:
139
154
  specification_version: 4
140
155
  summary: Integrate Litestream with the RubyGems infrastructure.