mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-26 13:13:51 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe71fa844a
|
||
|
|
cdeb2379e0
|
||
|
|
69ae920c90
|
||
|
|
a79d0621b6
|
||
|
|
d95f84be3f
|
||
|
|
63f680cc11
|
||
|
|
0ed6238ead
|
||
|
|
bb1e7341d0
|
No files matched your search
@@ -52,6 +52,7 @@
|
|||||||
- Fixed the Mathematics prototype, which told the AI that a correct derivative or integral had failed its check when the values of the function were far larger than those of its derivative.
|
- Fixed the Mathematics prototype, which told the AI that a correct derivative or integral had failed its check when the values of the function were far larger than those of its derivative.
|
||||||
- Fixed the Mathematics prototype getting stuck for a long time when it checked a result with a very large factorial or power. Meanwhile, no other calculation could run.
|
- Fixed the Mathematics prototype getting stuck for a long time when it checked a result with a very large factorial or power. Meanwhile, no other calculation could run.
|
||||||
- Fixed AI Studio ceasing to work when many files in a folder of a local data source changed within a short time, e.g., during a software build or while a sync tool updated the folder.
|
- Fixed AI Studio ceasing to work when many files in a folder of a local data source changed within a short time, e.g., during a software build or while a sync tool updated the folder.
|
||||||
|
- Fixed transcripts of audio and video files which could miss whole passages. Before a transcription, AI Studio converts the file into a compact format, and it stored a few pieces of the sound in a way that many programs could not read. They then skipped up to half a minute of the recording at a time, so that the transcript lacked what was said there.
|
||||||
- Upgraded several libraries to improve security.
|
- Upgraded several libraries to improve security.
|
||||||
- Upgraded Tauri to v2.12.7.
|
- Upgraded Tauri to v2.12.7.
|
||||||
- Upgraded MudBlazor to v9.14.0.
|
- Upgraded MudBlazor to v9.14.0.
|
||||||
|
|||||||
Generated
+46
-55
@@ -523,26 +523,22 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "audio-core"
|
name = "audio-codec-algorithms"
|
||||||
version = "0.2.1"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f93ebbf82d06013f4c41fe71303feb980cddd78496d904d06be627972de51a24"
|
checksum = "1254ebf6529f3763c491acfb5ab6e960809e3c75a38584cc664f8c5667fb7107"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "audioadapter"
|
name = "audioadapter"
|
||||||
version = "4.0.0"
|
version = "5.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c75c3943c6c7279bb25a449a8d1727480730ab2efd7b6fd5d6ca51927096e6e4"
|
checksum = "d1292ef9edf681b7426ed089004b021a42896492f58bd0c909ad44e5faec9ac4"
|
||||||
dependencies = [
|
|
||||||
"audio-core",
|
|
||||||
"num-traits",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "audioadapter-buffers"
|
name = "audioadapter-buffers"
|
||||||
version = "4.0.0"
|
version = "5.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ece3390b6eb40379094843a1da5aaccc34bc0d85a8cbf68d09fe092fee6de29e"
|
checksum = "46289a81a3bfa26d0f8b2415f8ca9decde9a66308a150568af5c102381b3c8ce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"audioadapter",
|
"audioadapter",
|
||||||
"audioadapter-sample",
|
"audioadapter-sample",
|
||||||
@@ -551,11 +547,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "audioadapter-sample"
|
name = "audioadapter-sample"
|
||||||
version = "4.0.0"
|
version = "5.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1592f90413568e259413c21a41a3d571feb1774255c209e7966d98f9db708c90"
|
checksum = "5258faecf4edbe35ec483bda9b1f7438e6b391891819269c6b5461aeaa0e8d7d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"audio-core",
|
"audio-codec-algorithms",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -685,9 +681,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum-server"
|
name = "axum-server"
|
||||||
version = "0.8.0"
|
version = "0.9.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1df331683d982a0b9492b38127151e6453639cd34926eb9c07d4cd8c6d22bfc"
|
checksum = "3766086d344b8f8d2a9cf6fb211b581de5b160e052d7bc75a92e58cc41909054"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"bytes",
|
"bytes",
|
||||||
@@ -700,6 +696,7 @@ dependencies = [
|
|||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustls",
|
"rustls",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
|
"socket2",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
@@ -1933,15 +1930,6 @@ dependencies = [
|
|||||||
"ctutils",
|
"ctutils",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dirs"
|
|
||||||
version = "6.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
|
|
||||||
dependencies = [
|
|
||||||
"dirs-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dirs"
|
name = "dirs"
|
||||||
version = "7.0.0"
|
version = "7.0.0"
|
||||||
@@ -2121,10 +2109,11 @@ checksum = "4a742b95783b1f45b900129082cbc47717b6a77ee8d17eea70a8ea62462f5de3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ebml-iterable"
|
name = "ebml-iterable"
|
||||||
version = "0.6.3"
|
version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b5173ac3752f08b526a6991509615e1a345b221ec3c58c7633433e8c9582312"
|
checksum = "152f8f4a13024011b26457b8b21040d9a9eb1222e693993ef037db391cd0c004"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
"ebml-iterable-specification",
|
"ebml-iterable-specification",
|
||||||
"ebml-iterable-specification-derive",
|
"ebml-iterable-specification-derive",
|
||||||
"futures",
|
"futures",
|
||||||
@@ -2452,11 +2441,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flexi_logger"
|
name = "flexi_logger"
|
||||||
version = "0.31.10"
|
version = "0.32.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a4945fa9cdfd7571192cf559c186d45ab36c8034482a2d217a19bdc566f190cc"
|
checksum = "5e87b74024da93123949cca26cb6e366744234fdd4d7914eb3dfeab0baa82d51"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"jiff 1.0.2",
|
||||||
"log",
|
"log",
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -4342,7 +4331,7 @@ dependencies = [
|
|||||||
"async-stream",
|
"async-stream",
|
||||||
"axum",
|
"axum",
|
||||||
"axum-server",
|
"axum-server",
|
||||||
"base64 0.22.1",
|
"base64 0.23.1",
|
||||||
"bytes",
|
"bytes",
|
||||||
"calamine",
|
"calamine",
|
||||||
"cbc 0.2.1",
|
"cbc 0.2.1",
|
||||||
@@ -4351,7 +4340,7 @@ dependencies = [
|
|||||||
"chrono",
|
"chrono",
|
||||||
"dbus-secret-service",
|
"dbus-secret-service",
|
||||||
"dbus-secret-service-keyring-store",
|
"dbus-secret-service-keyring-store",
|
||||||
"dirs 6.0.0",
|
"dirs",
|
||||||
"docx-to-md",
|
"docx-to-md",
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"file-format",
|
"file-format",
|
||||||
@@ -4385,7 +4374,7 @@ dependencies = [
|
|||||||
"subtle",
|
"subtle",
|
||||||
"symphonia",
|
"symphonia",
|
||||||
"sys-locale",
|
"sys-locale",
|
||||||
"sysinfo",
|
"sysinfo 0.40.4",
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
"tauri-plugin-dialog",
|
"tauri-plugin-dialog",
|
||||||
@@ -4963,17 +4952,6 @@ dependencies = [
|
|||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "objc2-open-directory"
|
|
||||||
version = "0.3.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bb82bed227edf5201dfedf072bba4015a33d3d4a98519837295a90f0a23f676d"
|
|
||||||
dependencies = [
|
|
||||||
"objc2",
|
|
||||||
"objc2-core-foundation",
|
|
||||||
"objc2-foundation",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objc2-osa-kit"
|
name = "objc2-osa-kit"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
@@ -5831,7 +5809,7 @@ dependencies = [
|
|||||||
"smallvec",
|
"smallvec",
|
||||||
"strum",
|
"strum",
|
||||||
"stumpalo",
|
"stumpalo",
|
||||||
"sysinfo",
|
"sysinfo 0.39.6",
|
||||||
"tap",
|
"tap",
|
||||||
"tar",
|
"tar",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
@@ -6344,9 +6322,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rubato"
|
name = "rubato"
|
||||||
version = "4.0.0"
|
version = "5.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f57c655d11e929f05a8663b323ff553f8d9773be05dfdc087795955bedeb8d92"
|
checksum = "6b4da228e06632d025557f798114057cf27a4c6a71d40024c84d6db82fa5ef4a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"audioadapter",
|
"audioadapter",
|
||||||
"audioadapter-buffers",
|
"audioadapter-buffers",
|
||||||
@@ -7499,7 +7477,20 @@ dependencies = [
|
|||||||
"ntapi",
|
"ntapi",
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
"objc2-io-kit",
|
"objc2-io-kit",
|
||||||
"objc2-open-directory",
|
"windows",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sysinfo"
|
||||||
|
version = "0.40.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3e80749408e2d8bec0ffa303012cf4e1b3b355f4a09087b4fdf7473680f6a2de"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"memchr",
|
||||||
|
"ntapi",
|
||||||
|
"objc2-core-foundation",
|
||||||
|
"objc2-io-kit",
|
||||||
"windows",
|
"windows",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -7626,7 +7617,7 @@ dependencies = [
|
|||||||
"anyhow",
|
"anyhow",
|
||||||
"bytes",
|
"bytes",
|
||||||
"cookie",
|
"cookie",
|
||||||
"dirs 7.0.0",
|
"dirs",
|
||||||
"dunce",
|
"dunce",
|
||||||
"embed_plist",
|
"embed_plist",
|
||||||
"getrandom 0.3.4",
|
"getrandom 0.3.4",
|
||||||
@@ -7676,7 +7667,7 @@ checksum = "73d80784e874fa117b9b00a6680cf2f9b8a51bbd14406bea980cf8f328b00646"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
"dirs 7.0.0",
|
"dirs",
|
||||||
"glob",
|
"glob",
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"json-patch",
|
"json-patch",
|
||||||
@@ -7873,7 +7864,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b"
|
checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.23.1",
|
"base64 0.23.1",
|
||||||
"dirs 7.0.0",
|
"dirs",
|
||||||
"flate2",
|
"flate2",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http",
|
||||||
@@ -8440,7 +8431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72"
|
checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"dirs 7.0.0",
|
"dirs",
|
||||||
"libappindicator",
|
"libappindicator",
|
||||||
"muda",
|
"muda",
|
||||||
"objc2",
|
"objc2",
|
||||||
@@ -9023,9 +9014,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webm-iterable"
|
name = "webm-iterable"
|
||||||
version = "0.6.4"
|
version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cd9fbf173b4b38f2f8bbb0082a0d4cb21f263a70811f5fccb1663c421c66d9f9"
|
checksum = "2b1f0c637f1c2b46d58a1b42b150135f8a31b024bfdcd56cc82febfbb20ba4c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ebml-iterable",
|
"ebml-iterable",
|
||||||
]
|
]
|
||||||
@@ -9615,7 +9606,7 @@ dependencies = [
|
|||||||
"block2",
|
"block2",
|
||||||
"cookie",
|
"cookie",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"dirs 7.0.0",
|
"dirs",
|
||||||
"dom_query 0.29.0",
|
"dom_query 0.29.0",
|
||||||
"dpi",
|
"dpi",
|
||||||
"dunce",
|
"dunce",
|
||||||
|
|||||||
+7
-7
@@ -30,18 +30,18 @@ tokio = { version = "1.54.1", features = ["rt", "rt-multi-thread", "macros", "pr
|
|||||||
tokio-stream = { version = "0.1.19", features = ["sync"] }
|
tokio-stream = { version = "0.1.19", features = ["sync"] }
|
||||||
futures = "0.3.34"
|
futures = "0.3.34"
|
||||||
async-stream = "0.3.6"
|
async-stream = "0.3.6"
|
||||||
flexi_logger = "0.31.10"
|
flexi_logger = "0.32.0"
|
||||||
chrono = "0.4.45"
|
chrono = "0.4.45"
|
||||||
dirs = "6.0.0"
|
dirs = "7.0.0"
|
||||||
log = { version = "0.4.35", features = ["kv"] }
|
log = { version = "0.4.35", features = ["kv"] }
|
||||||
once_cell = "1.21.4"
|
once_cell = "1.21.4"
|
||||||
axum = { version = "0.8.9", features = ["http2", "json", "query", "tokio"] }
|
axum = { version = "0.8.9", features = ["http2", "json", "query", "tokio"] }
|
||||||
axum-server = { version = "0.8.0", features = ["tls-rustls"] }
|
axum-server = { version = "0.9.2", features = ["tls-rustls"] }
|
||||||
rustls = { version = "0.23.46", default-features = false, features = ["aws_lc_rs"] }
|
rustls = { version = "0.23.46", default-features = false, features = ["aws_lc_rs"] }
|
||||||
rand = "0.10.4"
|
rand = "0.10.4"
|
||||||
rand_chacha = "0.10.0"
|
rand_chacha = "0.10.0"
|
||||||
subtle = "2.6.1"
|
subtle = "2.6.1"
|
||||||
base64 = "0.22.1"
|
base64 = "0.23.1"
|
||||||
aes = "0.9.4"
|
aes = "0.9.4"
|
||||||
cbc = "0.2.1"
|
cbc = "0.2.1"
|
||||||
pbkdf2 = "0.13.0"
|
pbkdf2 = "0.13.0"
|
||||||
@@ -63,8 +63,8 @@ encoding_rs = "0.8.44"
|
|||||||
|
|
||||||
symphonia = { version = "0.6", default-features = false, features = ["aac", "aiff", "alac", "caf", "flac", "isomp4", "mkv", "mp1", "mp2", "mp3", "ogg", "pcm", "vorbis", "wav"] }
|
symphonia = { version = "0.6", default-features = false, features = ["aac", "aiff", "alac", "caf", "flac", "isomp4", "mkv", "mp1", "mp2", "mp3", "ogg", "pcm", "vorbis", "wav"] }
|
||||||
ropus = "=0.12.18"
|
ropus = "=0.12.18"
|
||||||
rubato = { version = "4", default-features = false, features = ["fft_resampler"] }
|
rubato = { version = "5.1.0", default-features = false, features = ["fft_resampler"] }
|
||||||
webm-iterable = "0.6.4"
|
webm-iterable = "0.7.1"
|
||||||
calamine = "0.37.0"
|
calamine = "0.37.0"
|
||||||
|
|
||||||
# pdfium-render binds the functions of a certain PDFium version when it loads the library, and refuses a
|
# pdfium-render binds the functions of a certain PDFium version when it loads the library, and refuses a
|
||||||
@@ -88,7 +88,7 @@ onenote_parser = "2.1.0"
|
|||||||
typed-path = "0.12.4"
|
typed-path = "0.12.4"
|
||||||
tempfile = "3.27.0"
|
tempfile = "3.27.0"
|
||||||
strum_macros = "0.28.0"
|
strum_macros = "0.28.0"
|
||||||
sysinfo = "0.39.6"
|
sysinfo = { version = "0.40.4", default-features = false, features = ["system", "disk"] }
|
||||||
bytes = "1.12.2"
|
bytes = "1.12.2"
|
||||||
qdrant-edge = "0.9.0"
|
qdrant-edge = "0.9.0"
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -338,10 +338,13 @@ fn get_log_time(now: &mut DeferredNow, record: &log::Record) -> LogTime {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Case: The event happened earlier, e.g., in the .NET server. The logger
|
// Case: The event happened earlier, e.g., in the .NET server. The logger
|
||||||
// runs in UTC (see init_logging), so this time is written in UTC as well:
|
// runs in UTC (see init_logging), so this time is written in UTC as well.
|
||||||
|
// flexi_logger keeps the arrival time as a jiff value, whose microseconds
|
||||||
|
// since the Unix epoch carry it over to chrono:
|
||||||
Some(created_at) => LogTime {
|
Some(created_at) => LogTime {
|
||||||
timestamp: created_at.format(flexi_logger::TS_DASHES_BLANK_COLONS_DOT_BLANK).to_string(),
|
timestamp: created_at.format(flexi_logger::TS_DASHES_BLANK_COLONS_DOT_BLANK).to_string(),
|
||||||
delay_ms: get_notable_delay_ms(created_at, now.now_utc_owned()),
|
delay_ms: DateTime::<Utc>::from_timestamp_micros(now.now().timestamp().as_microsecond())
|
||||||
|
.and_then(|arrived_at| get_notable_delay_ms(created_at, arrived_at)),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1738,6 +1738,31 @@ mod tests {
|
|||||||
assert_eq!(clusters, 2);
|
assert_eq!(clusters, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Verifies that every block keeps a known size. A block of exactly 127 bytes, i.e., an Opus
|
||||||
|
/// packet of 123 bytes plus the 4 bytes of the block header, must not get the size 0xFF, which
|
||||||
|
/// EBML reserves for an element of unknown size.
|
||||||
|
#[test]
|
||||||
|
fn webm_writer_keeps_the_size_of_every_block_known() {
|
||||||
|
let path = std::env::temp_dir().join(format!("ai-studio-media-block-size-{}.webm", rand::random::<u64>()));
|
||||||
|
let mut writer = WebmOpusWriter::new(File::create(&path).unwrap()).unwrap();
|
||||||
|
for (index, packet_len) in [122, 123, 124].into_iter().enumerate() {
|
||||||
|
writer.write_packet(&vec![0xf8; packet_len], index as u64 * 960).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.finish().unwrap();
|
||||||
|
let bytes = fs::read(&path).unwrap();
|
||||||
|
let _ = fs::remove_file(path);
|
||||||
|
let tags = WebmIterator::new(Cursor::new(bytes), &[]).collect::<Result<Vec<_>, _>>().unwrap();
|
||||||
|
let block_lengths: Vec<_> = tags.iter()
|
||||||
|
.filter_map(|tag| match tag {
|
||||||
|
MatroskaSpec::SimpleBlock(block) => Some(block.len()),
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
assert_eq!(block_lengths, vec![126, 127, 128]);
|
||||||
|
}
|
||||||
|
|
||||||
/// Verifies deterministic arithmetic-mean downmixing.
|
/// Verifies deterministic arithmetic-mean downmixing.
|
||||||
#[test]
|
#[test]
|
||||||
fn downmix_is_bounded_and_balanced() {
|
fn downmix_is_bounded_and_balanced() {
|
||||||
|
|||||||
@@ -805,7 +805,7 @@ fn ensure_enough_space(required_bytes: u64, available_bytes: Option<u64>) -> Qdr
|
|||||||
/// path as it is serves as the fallback.
|
/// path as it is serves as the fallback.
|
||||||
fn available_space(path: &Path) -> Option<u64> {
|
fn available_space(path: &Path) -> Option<u64> {
|
||||||
let disks = sysinfo::Disks::new_with_refreshed_list()
|
let disks = sysinfo::Disks::new_with_refreshed_list()
|
||||||
.list()
|
.ok()?
|
||||||
.iter()
|
.iter()
|
||||||
.map(|disk| DiskSpace {
|
.map(|disk| DiskSpace {
|
||||||
mount_point: disk.mount_point().to_path_buf(),
|
mount_point: disk.mount_point().to_path_buf(),
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ pub fn kill_stale_process(pid_file_path: PathBuf, sidecar_type: SidecarType) ->
|
|||||||
let pid_file_content = fs::read_to_string(&pid_file_path)?;
|
let pid_file_content = fs::read_to_string(&pid_file_path)?;
|
||||||
let (pid, expected_name) = parse_pid_file(&pid_file_content)?;
|
let (pid, expected_name) = parse_pid_file(&pid_file_content)?;
|
||||||
|
|
||||||
let mut system = System::new_all();
|
// Refreshing the one process adds it, so the system needs to load nothing else:
|
||||||
|
let mut system = System::new().map_err(Error::other)?;
|
||||||
|
|
||||||
let pid = Pid::from_u32(pid);
|
let pid = Pid::from_u32(pid);
|
||||||
system.refresh_processes(ProcessesToUpdate::Some(&[pid]), true);
|
system.refresh_processes(ProcessesToUpdate::Some(&[pid]), true);
|
||||||
@@ -63,7 +64,17 @@ pub fn kill_stale_process(pid_file_path: PathBuf, sidecar_type: SidecarType) ->
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn log_potential_stale_process(pid_file_path: PathBuf, pid: u32, sidecar_type: SidecarType) {
|
pub fn log_potential_stale_process(pid_file_path: PathBuf, pid: u32, sidecar_type: SidecarType) {
|
||||||
let mut system = System::new_all();
|
let mut system = match System::new() {
|
||||||
|
Ok(system) => system,
|
||||||
|
Err(e) => {
|
||||||
|
warn!(Source="Stale Process Cleanup";
|
||||||
|
"{}: Pid file with process number '{}' was not created because the processes could not be read: {}",
|
||||||
|
sidecar_type, pid, e
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let pid = Pid::from_u32(pid);
|
let pid = Pid::from_u32(pid);
|
||||||
system.refresh_processes(ProcessesToUpdate::Some(&[pid]), true);
|
system.refresh_processes(ProcessesToUpdate::Some(&[pid]), true);
|
||||||
let Some(process) = system.process(pid) else {
|
let Some(process) = system.process(pid) else {
|
||||||
@@ -87,3 +98,26 @@ pub fn log_potential_stale_process(pid_file_path: PathBuf, pid: u32, sidecar_typ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The test starts `sleep`, which Windows lacks:
|
||||||
|
#[cfg(all(test, unix))]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
/// Verifies that a process found by its number alone gets a PID file and is killed later on.
|
||||||
|
#[test]
|
||||||
|
fn stale_process_is_recorded_and_killed() {
|
||||||
|
use std::os::unix::process::ExitStatusExt;
|
||||||
|
|
||||||
|
let mut child = std::process::Command::new("sleep").arg("30").spawn().unwrap();
|
||||||
|
let pid_file_path = std::env::temp_dir().join(format!("ai-studio-stale-process-{}.pid", rand::random::<u64>()));
|
||||||
|
|
||||||
|
log_potential_stale_process(pid_file_path.clone(), child.id(), SidecarType::Dotnet);
|
||||||
|
let content = fs::read_to_string(&pid_file_path).unwrap();
|
||||||
|
assert_eq!(content, format!("{}\nsleep\n", child.id()));
|
||||||
|
|
||||||
|
kill_stale_process(pid_file_path.clone(), SidecarType::Dotnet).unwrap();
|
||||||
|
assert!(!pid_file_path.exists());
|
||||||
|
assert_eq!(child.wait().unwrap().signal(), Some(9));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user