fix progress display
This commit is contained in:
@@ -295,6 +295,14 @@ impl Handler for HttpHandler {
|
||||
}
|
||||
chunk = chunk + 1;
|
||||
}
|
||||
BOARD_ACCESS
|
||||
.get()
|
||||
.await
|
||||
.lock()
|
||||
.await
|
||||
.board_hal
|
||||
.clear_progress()
|
||||
.await;
|
||||
Some(200)
|
||||
}
|
||||
Method::Post => {
|
||||
@@ -328,7 +336,14 @@ impl Handler for HttpHandler {
|
||||
offset = offset + to_write;
|
||||
chunk = chunk + 1;
|
||||
}
|
||||
|
||||
BOARD_ACCESS
|
||||
.get()
|
||||
.await
|
||||
.lock()
|
||||
.await
|
||||
.board_hal
|
||||
.clear_progress()
|
||||
.await;
|
||||
Some(200)
|
||||
}
|
||||
_ => None,
|
||||
@@ -460,6 +475,14 @@ where
|
||||
if is_last {
|
||||
let actual_crc = checksum.finalize();
|
||||
if actual_crc != expected_crc {
|
||||
BOARD_ACCESS
|
||||
.get()
|
||||
.await
|
||||
.lock()
|
||||
.await
|
||||
.board_hal
|
||||
.clear_progress()
|
||||
.await;
|
||||
conn.initiate_response(
|
||||
409,
|
||||
Some(
|
||||
@@ -503,7 +526,14 @@ where
|
||||
}
|
||||
chunk += 1;
|
||||
}
|
||||
|
||||
BOARD_ACCESS
|
||||
.get()
|
||||
.await
|
||||
.lock()
|
||||
.await
|
||||
.board_hal
|
||||
.clear_progress()
|
||||
.await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -545,6 +575,7 @@ where
|
||||
.get_rtc_module()
|
||||
.backup_config_finalize(checksum.finalize(), offset)
|
||||
.await?;
|
||||
board.board_hal.clear_progress().await;
|
||||
Ok(Some("saved".to_owned()))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user