litestream-ruby icon indicating copy to clipboard operation
litestream-ruby copied to clipboard

Fix Litestream.replicate_process for systemd

Open rossta opened this issue 7 months ago • 0 comments

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.

rossta avatar Jul 01 '24 15:07 rossta