Skip to content

Conversation

@jclapis
Copy link
Collaborator

@jclapis jclapis commented Nov 19, 2025

This closes the first request in #382 by automatically reloading the config for the PBS service as though /reload were called whenever the config file changes. There are a few ways to do this, but I settled on propagating the path from the config loader instead of making it a field within the PbsConfig, because it didn't feel like a good fit for that.

Note that the Signer service doesn't do hot-reloading, because it's a much different setup that will require more planning. That might be OBE during the config revamp anyway so I'm leaving it out for now.

@jclapis jclapis self-assigned this Nov 19, 2025
@jclapis jclapis added the pbs Pbs module / Builder API label Nov 19, 2025
// Set up the filesystem watcher for the config file
let mut watcher: RecommendedWatcher;
if config_path.to_str() != Some("") {
let state_for_watcher = state.clone();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would add a couple of logs:

  • that we start the file watcher
  • when trying to reload the config

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done in 8d77531.

let config_path_for_watcher = config_path.clone();
watcher = RecommendedWatcher::new(
move |result: Result<Event, Error>| {
let event = result.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why unwrap here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just how their example usage worked, but I replaced it with a match in 8d77531.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pbs Pbs module / Builder API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants