fractaledmind / litestream-ruby

MIT License
71 stars 6 forks source link

Fix Litestream.replicate_process for systemd #32

Closed rossta closed 1 week ago

rossta commented 1 month ago

When I try to run Litestream.replicate_process, as in mounting the web ui, in production with systemd, I see the following error:

Date::Error: invalid date
    lib/litestream.rb:88:in `strptime'
    lib/litestream.rb:88:in `block in replicate_process'
    lib/litestream.rb:78:in `each'
    lib/litestream.rb:78:in `replicate_process'

The line splitting logic did not appear to work in my environment nor for the example output displayed in the comments of the replicate_process method.

This PR adds basic proof-of-concept tests for both variations of replicate_process and adds a fix for the DateTime parsing logic with systemd. In fixing that issue, I also encountered a bug in the status parsing logic for systemd which is also now addressed using a regex with a named capture group.

fractaledmind commented 1 week ago

Released as v0.10.5