mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 08:21:04 +00:00
The Rust part of #2818, split out so each PR stays small. Clears the open rust:S7493, rust:S7458 and secrets:S6418 issues. Compile and tests are left to CI. - rust:S7493: `tokio::fs` in place of blocking `std::fs` inside async functions (`auto_download`, `simple_http_download`, the fal/Sora/WorldLabs downloads, the `sqlite_tasks` reset), as in #2803/#2804. The downloaded bytes are handed to `tokio::fs::write` owned (no copy), per CodeRabbit on #2818. `sqlite_tasks` now depends on workspace `tokio` with `fs` (one line in `Cargo.lock`). - rust:S7458: `TaskId`'s inherent `to_string` is removed. `Display` gives the same string. - secrets:S6418: the `#[ignore]` WorldLabs refresh-token test reads `WORLDLABS_REFRESH_TOKEN` instead of holding a token in source. ⚠️ The token is still in git history, so its owner should revoke it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Refactor** * Downloaded files and task checkpoints are now handled using asynchronous file operations across several generation workflows. * Database-file cleanup during connection and migration is also asynchronous; removal errors continue to be logged, and migration proceeds. * These changes preserve the existing download, checkpoint, and error-handling behavior while reducing blocking file operations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
44 lines
1.1 KiB
TOML
44 lines
1.1 KiB
TOML
[package]
|
|
name = "sqlite_tasks"
|
|
edition = "2024"
|
|
version = "0.0.1"
|
|
publish = false
|
|
|
|
[lib]
|
|
name = "sqlite_tasks"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
|
|
# Internal
|
|
enums.workspace = true
|
|
errors.workspace = true
|
|
tokens.workspace = true
|
|
|
|
# External
|
|
anyhow.workspace = true
|
|
chrono.workspace = true
|
|
log.workspace = true
|
|
tokio = { workspace = true, features = ["fs"] }
|
|
|
|
# TODO(bt,2025-07-09): Update sqlx ASAP. We're stuck on 0.7 because of the complex use of internal types and macros in the database crate.
|
|
# We're going to embed in-memory SQLite
|
|
sqlx = { package = "sqlx", version = "0.7.4", features = ["runtime-tokio-rustls", "sqlite", "chrono"] }
|
|
|
|
# Needed to safety check some queries we can't use escaping for
|
|
once_cell.workspace = true
|
|
regex.workspace = true
|
|
|
|
# Serialization
|
|
serde.workspace = true
|
|
serde_derive.workspace = true
|
|
serde_json.workspace = true
|
|
|
|
[dev-dependencies]
|
|
# serial_test = "3.0.0"
|
|
|
|
[build-dependencies]
|
|
tempfile.workspace = true
|
|
sqlx = { package = "sqlx", version = "0.7.4", features = ["runtime-tokio-rustls", "sqlite", "chrono"] }
|
|
#rusqlite = "0.25.4" # NB: For the build.rs file
|