Merge pull request #798 from jb-alvarado/master

catch error, set is_processing to false on status
This commit is contained in:
jb-alvarado 2024-10-06 20:53:30 +02:00 committed by GitHub
commit 3cb0b2cf25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 12 deletions

8
Cargo.lock generated
View File

@ -1215,7 +1215,7 @@ checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
[[package]]
name = "ffplayout"
version = "0.24.0-rc1"
version = "0.24.0-rc2"
dependencies = [
"actix-files",
"actix-multipart",
@ -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",
@ -3674,7 +3674,7 @@ dependencies = [
[[package]]
name = "tests"
version = "0.24.0-rc1"
version = "0.24.0-rc2"
dependencies = [
"actix-rt",
"actix-test",

View File

@ -5,7 +5,7 @@ resolver = "2"
[workspace.package]
description = "24/7 playout based on rust and ffmpeg"
readme = "README.md"
version = "0.24.0-rc1"
version = "0.24.0-rc2"
license = "GPL-3.0"
repository = "https://github.com/ffplayout/ffplayout"
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]

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) => {
if (response === 'active') {
showModal.value = true
}
await configStore.getPlayoutConfig()
})
.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)
})
}