Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/conf/proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use types::{AccessibleDirectory, AutoRestart, ExecutableFile, HealthCheck, StopS
/// Rust representation of the `taskmaster` config. All its types implement
/// the `Deserializer` trait.
#[allow(unused)]
#[derive(Clone, Debug, Deserialize)]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ProcessConfig {
/// User to spawn the process as.
Expand Down
2 changes: 1 addition & 1 deletion src/conf/proc/types/autorestart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer};
///
/// Implements the `serde::Deserializer` trait for the `autorestart` field of the configuration.
#[allow(unused)]
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub struct AutoRestart {
pub mode: String,
pub max_retries: Option<u8>,
Expand Down
8 changes: 4 additions & 4 deletions src/conf/proc/types/healthcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ fn dflt_retries() -> usize {
5
}

#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Debug, Clone, PartialEq)]
#[serde(untagged)]
pub enum HealthCheckType {
Command(CommandHealthCheck),
Uptime(UptimeHealthCheck),
}

#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Debug, Clone, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct CommandHealthCheck {
/// Command to run as a healthcheck.
Expand Down Expand Up @@ -56,7 +56,7 @@ pub struct CommandHealthCheck {
pub timeout: usize,
}

#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Debug, Clone, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct UptimeHealthCheck {
/// Time (in seconds) after which the process will be deemed healthy.
Expand All @@ -68,7 +68,7 @@ pub struct UptimeHealthCheck {
}

#[allow(unused)]
#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Debug, Clone, PartialEq)]
pub struct HealthCheck {
/// Inferred from the configured fields.
///
Expand Down
4 changes: 2 additions & 2 deletions src/conf/proc/types/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<'de> Deserialize<'de> for AccessibleDirectory {
///
/// Implements the `serde::Deserializer` trait for the `cmd` field of the configuration.
#[allow(unused)]
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub struct ExecutableFile {
path: String,
}
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<'de> Deserialize<'de> for ExecutableFile {
///
/// Implements the `serde::Deserializer` trait for the `stdout` and `stderr` fields of the configuration.
#[allow(unused)]
#[derive(Debug, Clone, Default)]
#[derive(Debug, Clone, Default, PartialEq)]
pub struct WritableFile {
path: String,
}
Expand Down
3 changes: 3 additions & 0 deletions src/run/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ impl Daemon {
for (process_name_new, process_new) in daemon_new.processes_mut().drain() {
match self.processes_mut().get_mut(&process_name_new.to_owned()) {
Some(process_old) => {
if process_old.config() != process_new.config() {
process_old.push_desired_state(ProcessState::Stopped);
}
*process_old.config_mut() = process_new.config().clone();

match process_old.config().autostart() {
Expand Down