Files
scraper/Cargo.toml
T
asepharyana 966d86ff67
Deploy Scraper / build-and-deploy (push) Canceled after 0s
refactor: migrate thread/async/queue/scheduler infra to mytheclipse
- bootstrap: TracingLayer from mytheclipse-tracing (composed with scraper
  env filter), RuntimeConfig::auto() thread logging, init job queue + cron.
- proxy_fetch: leader task via ::mytheclipse::spawn_io, gzip decompression
  offloaded to ::mytheclipse::compute (sized rayon pool, panic-isolated),
  bounded by new async fetch limiter (tokio Semaphore bridge).
- queue: new infrastructure/queue module over mytheclipse-queue
  (InMemoryQueue + WorkerPool + BackpressureEnforcer) for repair jobs.
- scheduler: new infrastructure/scheduler.rs using mytheclipse::cron for
  the daily 02:00 UTC image-cache cleanup.
- deps: add mytheclipse-queue + mytheclipse-tracing path deps; mytheclipse
  -> full feature; rayon 1.12; keep path deps for unpublished crates.
- tests: infra_round2 runtime smoke tests (compute panic isolation,
  spawn_io, backpressure admission, cron parse, queue roundtrip).
- Fix: local cache::mytheclipse bridge module shadowed the mytheclipse
  crate name; use leading :: at spawn_io/compute call sites.
2026-08-30 19:40:01 +07:00

127 lines
4.5 KiB
TOML

[package]
name = "scraper-service"
version = "0.1.0"
edition = "2021"
description = "A batteries-included, production-ready Rust web framework built on Axum"
authors = ["Asep Haryana"]
license = "MIT"
repository = "https://github.com/MythEclipse/ultimate-asepharyana.tech"
keywords = ["web", "framework", "axum", "api", "rest"]
categories = ["web-programming::http-server", "web-programming::websocket"]
default-run = "scraper"
# Dependensi yang dibutuhkan saat aplikasi berjalan
[dependencies]
# Mytheclipse workspace (user's custom library) — path deps so the scraper
# builds against the user's actual current source (1.21.x incl. unpublished
# cache redis-0.32 fix). Switch to version deps once crates.io catches up.
mytheclipse = { path = "/home/code/mytheclipse/crates/mytheclipse", features = ["full"] }
mytheclipse-cache = { path = "/home/code/mytheclipse/crates/mytheclipse-cache", features = ["l2-redis", "cache-aside"] }
mytheclipse-config = { path = "/home/code/mytheclipse/crates/mytheclipse-config" }
mytheclipse-event = { path = "/home/code/mytheclipse/crates/mytheclipse-event" }
mytheclipse-queue = { path = "/home/code/mytheclipse/crates/mytheclipse-queue", features = ["in-memory"] }
mytheclipse-tracing = { path = "/home/code/mytheclipse/crates/mytheclipse-tracing", features = ["env"] }
axum = { version = "0.8.8", features = ["ws", "multipart", "macros"] }
tokio = { version = "1.49.0", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
dotenvy = "0.15"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
anyhow = "1.0"
# sqlx removed - SeaORM uses it internally via sqlx-postgres feature
sea-orm = { version = "1.1.19", features = ["sqlx-postgres", "runtime-tokio-rustls", "macros", "with-chrono", "with-uuid"] }
uuid = { version = "1.10.0", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
futures = "0.3"
reqwest = { version = "0.12.28", features = ["json", "stream", "multipart"] }
http = "1.4.0"
async-trait = "0.1.89"
regex = "1.12.2"
urlencoding = "2.1"
url = "2.5.8"
tower-http = { version = "0.6.8", features = ["fs", "cors", "compression-gzip", "compression-br", "compression-zstd"] }
dashmap = "6.1"
deadpool-redis = { version = "0.22.1", features = ["serde"] }
rayon = "1.12"
scraper = "0.25.0"
flate2 = "1.1"
redis = { version = "0.32.7", features = ["tokio-rustls-comp", "safe_iterators"] }
thiserror = "2.0.18"
utoipa = { version = "5.0", features = ["axum_extras"] }
utoipa-swagger-ui = { version = "9.0", features = ["axum"] }
# OpenTelemetry metrics
opentelemetry = { version = "0.27", features = ["metrics"] }
opentelemetry_sdk = { version = "0.27", features = ["metrics", "rt-tokio"] }
opentelemetry-otlp = { version = "0.27", features = ["metrics"] }
# Dependensi yang hanya dibutuhkan untuk build script (build.rs)
# Dependensi yang hanya dibutuhkan untuk tes
[dev-dependencies]
sea-orm = { version = "1.1.19", features = ["sqlx-postgres", "runtime-tokio-rustls", "macros", "with-chrono", "with-uuid", "mock"] }
# Definisi targets secara eksplisit untuk menghindari peringatan cargo-chef (edition/plugin)
[lib]
name = "scraper_service"
path = "src/lib.rs"
[[bin]]
name = "scraper"
path = "src/main.rs"
[lints.rust]
unsafe_code = "forbid"
unused_variables = "deny"
unused_imports = "deny"
unused_must_use = "deny"
dead_code = "deny"
unused_mut = "deny"
unreachable_code = "deny"
trivial_casts = "deny"
trivial_numeric_casts = "deny"
explicit_outlives_requirements = "deny"
unused_labels = "deny"
unused_braces = "deny"
noop_method_call = "deny"
[lints.clippy]
unwrap_used = "warn"
expect_used = "warn"
panic = "deny"
todo = "deny"
unimplemented = "deny"
unnecessary_to_owned = "deny"
[features]
# default = ["ffmpeg"]
ffmpeg = []
# Profile optimasi untuk production - fokus pada performa runtime maksimal
[profile.release]
opt-level = 3 # Optimasi level maksimal
lto = "fat" # Full LTO untuk inlining maksimal dan binary optimal
codegen-units = 1 # Single codegen unit untuk optimasi maksimal (lebih lambat build, binary lebih cepat)
incremental = false # Disable incremental untuk optimasi penuh
debug = false # No debug info untuk binary lebih kecil
strip = true # Strip symbols untuk binary lebih kecil
panic = "abort" # Abort on panic (binary lebih kecil dan lebih cepat)
overflow-checks = false # Non-overflowing arithmetic for speed (disable in debug)
# Optimize dependencies too
[profile.dev]
opt-level = 0
[profile.bench]
opt-level = 3
lto = "fat"