Skip to content

Commit

Permalink
Merge pull request #6 from supermomonga/release-resources
Browse files Browse the repository at this point in the history
Exit Ruby process to release memory resource
  • Loading branch information
fractaledmind authored Feb 6, 2024
2 parents d4c843f + 42e956e commit cf8ff83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/litestream/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ def self.replicate(argv = {})

command = [executable, "replicate", *args]
puts command.inspect
system(*command)

# To release the resources of the Ruby process, just fork and exit.
# The forked process executes litestream and replaces itself.
if fork.nil?
exec(*command)
end
end
end
end

0 comments on commit cf8ff83

Please sign in to comment.