fix: Load updated configs on daemon restart

This commit is contained in:
Arne Beer 2021-09-12 11:32:47 +02:00
parent ac9ecc29d1
commit 6af8b34b4c
No known key found for this signature in database
GPG key ID: CC9408F679023B65
2 changed files with 9 additions and 1 deletions

View file

@ -10,6 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Add the `--working-directory` parameter to the `pueue add` command [#227](https://github.com/Nukesor/pueue/issues/227).
## [1.0.2] - 12-09-2021
### Fix
- Settings weren't always read on daemon restart.
This bug was introduced in `1.0.0` due to large-scale refactorings and insufficient testing.
## [1.0.1] - 20-08-2021
### Fix

View file

@ -62,7 +62,7 @@ pub async fn run(config_path: Option<PathBuf>, test: bool) -> Result<()> {
// Restore the previous state and save any changes that might have happened during this
// process. If no previous state exists, just create a new one.
// Create a new empty state if any errors occur, but print the error message.
let state = match restore_state(&settings.shared.pueue_directory()) {
let mut state = match restore_state(&settings.shared.pueue_directory()) {
Ok(Some(state)) => state,
Ok(None) => State::new(&settings, config_path.clone()),
Err(error) => {
@ -71,6 +71,7 @@ pub async fn run(config_path: Option<PathBuf>, test: bool) -> Result<()> {
State::new(&settings, config_path.clone())
}
};
state.settings = settings.clone();
save_state(&state)?;
let state = Arc::new(Mutex::new(state));