Skip to content

Commit 55401a9

Browse files
committed
fix: compress_status_file -> compress_state_file
1 parent de16723 commit 55401a9

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Upon updating Pueue and restarting the daemon, the previous state will be wiped,
7979
- Print most of Pueue's info/log messages to `stderr`. Only keep useful stuff like json and task log output on `stdout`.
8080
- **Breaking**: Ported from `anyhow` to `color_eyre` for prettier log output.
8181
- **Breaking**: Switch `cbor` handling library, potentially breaking backwards-compatible communication on a data format level.
82-
- Option to save the state in compressed form. This can be toggled with the `daemon.compress_status_file` config file.
82+
- Option to save the state in compressed form. This can be toggled with the `daemon.compress_state_file` config file.
8383
Preliminary testing shows significant compression ratios (up to x15), which helps with large states in embedded and I/O bound environments.
8484

8585
### Add

pueue/src/daemon/internal_state/state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl InternalState {
254254
let mut temp = path.join("state.json.partial");
255255
let mut real = path.join("state.json");
256256

257-
if settings.daemon.compress_status_file {
257+
if settings.daemon.compress_state_file {
258258
temp = path.join("state.json.gz.partial");
259259
real = path.join("state.json.gz");
260260

@@ -290,7 +290,7 @@ impl InternalState {
290290
let pueue_directory = settings.shared.pueue_directory();
291291
let mut path = pueue_directory.join("state.json");
292292

293-
if settings.daemon.compress_status_file {
293+
if settings.daemon.compress_state_file {
294294
path = pueue_directory.join("state.json.gz");
295295
}
296296

@@ -302,7 +302,7 @@ impl InternalState {
302302
info!("Restoring state");
303303

304304
// Try to load the file.
305-
let data = if settings.daemon.compress_status_file {
305+
let data = if settings.daemon.compress_state_file {
306306
let file = File::open(path)?;
307307
let mut decoder = flate2::read::GzDecoder::new(file);
308308
let mut data = String::new();

pueue/tests/daemon/integration/restore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::{helper::*, internal_prelude::*};
1111
#[tokio::test]
1212
async fn test_start_running(#[case] compress: bool) -> Result<()> {
1313
let (mut settings, tempdir) = daemon_base_setup()?;
14-
settings.daemon.compress_status_file = compress;
14+
settings.daemon.compress_state_file = compress;
1515
settings
1616
.save(&Some(tempdir.path().join("pueue.yml")))
1717
.context("Couldn't write pueue config to temporary directory")?;
@@ -46,7 +46,7 @@ async fn test_start_running(#[case] compress: bool) -> Result<()> {
4646
#[tokio::test]
4747
async fn test_start_paused(#[case] compress: bool) -> Result<()> {
4848
let (mut settings, tempdir) = daemon_base_setup()?;
49-
settings.daemon.compress_status_file = compress;
49+
settings.daemon.compress_state_file = compress;
5050
settings
5151
.save(&Some(tempdir.path().join("pueue.yml")))
5252
.context("Couldn't write pueue config to temporary directory")?;

pueue_lib/src/settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub struct Daemon {
143143
/// The state tends to be quite large for many tasks, as the whole environment is copied every
144144
/// time. You can expect a ~10 compression ratio.
145145
#[serde(default = "Default::default")]
146-
pub compress_status_file: bool,
146+
pub compress_state_file: bool,
147147
/// The callback that's called whenever a task finishes.
148148
pub callback: Option<String>,
149149
/// Environment variables that can be will be injected into all executed processes.
@@ -218,7 +218,7 @@ impl Default for Daemon {
218218
pause_all_on_failure: false,
219219
callback: None,
220220
callback_log_lines: default_callback_log_lines(),
221-
compress_status_file: false,
221+
compress_state_file: false,
222222
shell_command: None,
223223
env_vars: HashMap::new(),
224224
}

0 commit comments

Comments
 (0)