Skip to content

feature: Reducing the downtime of a long-running process #387

@Mcdostone

Description

@Mcdostone

Hi, I work on a web application written in Rust.
I use bacon as a watcher to restart automatically the backend server whenever I make a change. Here’s my current bacon.toml file:

default_job = "check"

[jobs.check]
command = ["cargo", "check"]
need_stdout = false

[jobs.run]
command = [
    "cargo", "run", "server"
]
need_stdout = true
allow_warnings = true
background = false
on_change_strategy = "kill_then_restart"
watch = ["templates/"]

Compiling my project takes about 5s. When I edit an HTML file in the templates directory (these files are embedded in the rust binary using askama) and save it, bacon triggers a rebuild and restart. The process looks like this:

Image

I’d like to reduce the downtime of my Rust binary during this process. Ideally, it would work more like this:

Image

I tried using the wait_and_restart strategy, but the server never restarts. I’m not very familiar with bacon, so I might be missing something in the configuration.

Any help would be appreciated!
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions