Skip to content

Commit 3d19612

Browse files
committed
fix linter errors [skip ci]
1 parent 438ad78 commit 3d19612

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

compute/src/main.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,16 @@ async fn main() -> Result<()> {
3333
let token = CancellationToken::new();
3434
let cancellation_token = token.clone();
3535
tokio::spawn(async move {
36-
if let Some(timeout_str) = env::var("DKN_EXIT_TIMEOUT").ok() {
36+
if let Ok(timeout_str) = env::var("DKN_EXIT_TIMEOUT") {
3737
let duration_secs = timeout_str.parse().unwrap_or(120);
3838
log::warn!("Waiting for {} seconds before exiting.", duration_secs);
3939
tokio::time::sleep(tokio::time::Duration::from_secs(duration_secs)).await;
4040
cancellation_token.cancel();
41-
} else {
42-
if let Err(err) = wait_for_termination(cancellation_token.clone()).await {
43-
log::error!("Error waiting for termination: {:?}", err);
44-
log::error!("Cancelling due to unexpected error.");
45-
cancellation_token.cancel();
46-
};
47-
}
41+
} else if let Err(err) = wait_for_termination(cancellation_token.clone()).await {
42+
log::error!("Error waiting for termination: {:?}", err);
43+
log::error!("Cancelling due to unexpected error.");
44+
cancellation_token.cancel();
45+
};
4846
});
4947

5048
// create configurations & check required services & address in use

0 commit comments

Comments
 (0)