Saving changes
This commit is contained in:
+19
-1
@@ -14,8 +14,26 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
};
|
||||
|
||||
let auth = catapult::service::auth::Auth {
|
||||
app: app.clone()
|
||||
};
|
||||
let token = match auth.get_token().await {
|
||||
Ok(token) => token,
|
||||
Err(err) => {
|
||||
eprintln!("Error getting token");
|
||||
eprintln!("Error: {err:?}");
|
||||
std::process::exit(-1);
|
||||
}
|
||||
};
|
||||
|
||||
let mut svc = catapult::service::Service {
|
||||
app: app.clone(),
|
||||
token
|
||||
};
|
||||
|
||||
loop {
|
||||
catapult::service::do_the_work(&app).await;
|
||||
// catapult::service::do_the_work(&app).await;
|
||||
svc.do_the_work().await;
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(
|
||||
catapult::app::SECONDS_TO_SLEEP,
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user