Skip to content

Commit

Permalink
Revert "feat: precondition checks as a feature (#322)"
Browse files Browse the repository at this point in the history
This reverts commit 5018130.
  • Loading branch information
de-sh authored Feb 20, 2024
1 parent 5018130 commit ee6f2a5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 100 deletions.
1 change: 0 additions & 1 deletion uplink/src/collector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub mod installer;
pub mod journalctl;
#[cfg(target_os = "android")]
pub mod logcat;
pub mod preconditions;
pub mod process;
pub mod script_runner;
pub mod simulator;
Expand Down
84 changes: 0 additions & 84 deletions uplink/src/collector/preconditions.rs

This file was deleted.

7 changes: 0 additions & 7 deletions uplink/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ impl Default for DeviceShadowConfig {
}
}

#[derive(Debug, Clone, Deserialize)]
pub struct PreconditionCheckerConfig {
pub path: PathBuf,
pub actions: Vec<ActionRoute>,
}

#[derive(Debug, Clone, Deserialize, Default)]
pub struct Config {
pub project_id: String,
Expand Down Expand Up @@ -280,5 +274,4 @@ pub struct Config {
pub logging: Option<JournalCtlConfig>,
#[cfg(target_os = "android")]
pub logging: Option<LogcatConfig>,
pub precondition_checks: Option<PreconditionCheckerConfig>,
}
9 changes: 1 addition & 8 deletions uplink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ use collector::installer::OTAInstaller;
use collector::journalctl::JournalCtl;
#[cfg(target_os = "android")]
use collector::logcat::Logcat;
use collector::preconditions::PreconditionChecker;
use collector::process::ProcessHandler;
use collector::script_runner::ScriptRunner;
use collector::systemstats::StatCollector;
Expand Down Expand Up @@ -295,20 +294,14 @@ impl Uplink {

if !self.config.script_runner.is_empty() {
let actions_rx = bridge.register_action_routes(&self.config.script_runner)?;
let script_runner = ScriptRunner::new(actions_rx, bridge_tx.clone());
let script_runner = ScriptRunner::new(actions_rx, bridge_tx);
spawn_named_thread("Script Runner", || {
if let Err(e) = script_runner.start() {
error!("Script runner stopped!! Error = {:?}", e);
}
});
}

if let Some(checker_config) = &self.config.precondition_checks {
let actions_rx = bridge.register_action_routes(&checker_config.actions)?;
let checker = PreconditionChecker::new(self.config.clone(), actions_rx, bridge_tx);
spawn_named_thread("Logger", || checker.start());
}

Ok(())
}

Expand Down

0 comments on commit ee6f2a5

Please sign in to comment.