catch error, set is_processing to false on status

This commit is contained in:
Jonathan Baecker 2024-10-06 20:44:21 +02:00
parent b0f03f52f9
commit f0b01fc0ff
4 changed files with 17 additions and 9 deletions

4
Cargo.lock generated
View File

@ -3647,9 +3647,9 @@ dependencies = [
[[package]]
name = "sysinfo"
version = "0.31.4"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be"
checksum = "e3b5ae3f4f7d64646c46c4cae4e3f01d1c5d255c7406fdd7c7f999a94e488791"
dependencies = [
"core-foundation-sys",
"libc",

View File

@ -55,7 +55,7 @@ serde_json = "1.0"
serde_with = "3.8"
shlex = "1.1"
static-files = "0.2"
sysinfo ={ version = "0.31", features = ["linux-netdevs", "linux-tmpfs"] }
sysinfo ={ version = "0.32", features = ["linux-netdevs", "linux-tmpfs"] }
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"] }
time = { version = "0.3", features = ["formatting", "macros"] }
tokio = { version = "1.29", features = ["full"] }

View File

@ -956,6 +956,8 @@ pub async fn process_control(
match proc.into_inner().command {
ProcessCtl::Status => {
manager.is_processing.store(false, Ordering::SeqCst);
if manager.is_alive.load(Ordering::SeqCst) {
return Ok(web::Json("active"));
} else {

View File

@ -183,13 +183,17 @@ async function onSubmitPlayout() {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: 'status' }),
}).then(async (response: any) => {
})
.then(async (response: any) => {
if (response === 'active') {
showModal.value = true
}
await configStore.getPlayoutConfig()
})
.catch((e) => {
indexStore.msgAlert('error', e.data, 3)
})
} else {
indexStore.msgAlert('error', t('config.updatePlayoutFailed'), 2)
}
@ -203,6 +207,8 @@ async function restart(res: boolean) {
method: 'POST',
headers: { ...configStore.contentType, ...authStore.authHeader },
body: JSON.stringify({ command: 'restart' }),
}).catch((e) => {
indexStore.msgAlert('error', e.data, 3)
})
}