Skip to content

Commit

Permalink
fix: don't do persistence in ssh check
Browse files Browse the repository at this point in the history
  • Loading branch information
dbcfd committed Feb 27, 2024
1 parent be7a3de commit 3f5635e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions checkpointer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,22 @@ async fn main() -> Result<(), Error> {
let _guard = util::init_tracing();
let cmd = Cli::parse();

let config = Config {
batcher: Batcher::new(Arc::new(SqlitePersistence::new().await?))?,
calculator_params: CalculatorParameters::new().await?,
calculate_active: Arc::new(AtomicBool::new(false)),
};

let calculator_params = CalculatorParameters::new().await?;
match cmd.subcmd {
Some(SubCmd::SshCheck) => {
let url = config
.calculator_params
let url = calculator_params
.ceramic_url
.join("/api/v0/node/healthcheck")?;
if !reqwest::get(url).await?.status().is_success() {
return Err(Error::custom("Failed to connect to ceramic"));
}
}
None => {
let config = Config {
batcher: Batcher::new(Arc::new(SqlitePersistence::new().await?))?,
calculator_params,
calculate_active: Arc::new(AtomicBool::new(false)),
};
start_server(config).await?;
}
}
Expand Down

0 comments on commit 3f5635e

Please sign in to comment.