Skip to content

Commit

Permalink
Still run the replicate command even if no Ruby configuration present…
Browse files Browse the repository at this point in the history
… (presume user has manually set ENV variables, or manually setup litestream.yml config file
  • Loading branch information
fractaledmind committed Dec 21, 2023
1 parent 6618c93 commit 2eb2de2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/litestream/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ def self.executable(exe_path: DEFAULT_DIR)
end

def self.replicate
return if Litestream.configuration.nil?

ENV["LITESTREAM_DATABASE_PATH"] = Litestream.configuration.database_path
ENV["LITESTREAM_REPLICA_URL"] = Litestream.configuration.replica_url
ENV["LITESTREAM_ACCESS_KEY_ID"] = Litestream.configuration.replica_key_id
ENV["LITESTREAM_SECRET_ACCESS_KEY"] = Litestream.configuration.replica_access_key
if Litestream.configuration
ENV["LITESTREAM_DATABASE_PATH"] = Litestream.configuration.database_path
ENV["LITESTREAM_REPLICA_URL"] = Litestream.configuration.replica_url
ENV["LITESTREAM_ACCESS_KEY_ID"] = Litestream.configuration.replica_key_id
ENV["LITESTREAM_SECRET_ACCESS_KEY"] = Litestream.configuration.replica_access_key
end

system(executable, "replicate", "--config", Rails.root.join("config", "litestream.yml").to_s)
end
Expand Down

0 comments on commit 2eb2de2

Please sign in to comment.