diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67dd3c3..4021cc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -246,9 +246,9 @@ jobs: env: RUSTFLAGS: "" - if: ${{ matrix.cross }} - run: cross +beta build --features tokio-current-thread,tui --release --target '${{ matrix.target }}' --locked + run: cross +beta build --features tui --release --target '${{ matrix.target }}' --locked - if: ${{ !matrix.cross }} - run: cargo +beta build --features tokio-current-thread,tui --release --target '${{ matrix.target }}' --locked + run: cargo +beta build --features tui --release --target '${{ matrix.target }}' --locked - run: mkdir dist - run: echo -n '${{ github.sha }}' > dist/commit-sha.txt shell: bash diff --git a/Cargo.toml b/Cargo.toml index 217590e..c668cff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,12 +55,13 @@ smallvec = { version = "=1.15.1", features = [ "union", ], optional = true } strum = { version = "=0.27.2", features = ["derive"], optional = true } -tokio = { version = "=1.48.0", features = ["full"] } +tokio = { version = "=1.48.0", features = ["fs", "parking_lot", "signal"] } tokio-util = "=0.7.17" toml = "=0.9.8" -tracing = { version = "=0.1.41", features = [ +tracing = { version = "=0.1.41", default-features = false, features = [ "max_level_debug", "release_max_level_debug", + "std", ] } tracing-subscriber = { version = "=0.3.20", features = ["parking_lot"] } tui-logger = { version = "=0.17.4", features = [ @@ -79,7 +80,7 @@ dhat = ["dep:dhat"] jemalloc = ["dep:tikv-jemallocator"] mimalloc_v2 = ["dep:mimalloc"] mimalloc_v3 = ["dep:mimalloc", "mimalloc/v3"] -tokio-current-thread = [] +tokio-multi-thread = [] tui = [ "dep:crossterm", "dep:futures", diff --git a/Dockerfile b/Dockerfile index f0b78b2..9c71444 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN --mount=source=src,target=src \ --mount=source=Cargo.lock,target=Cargo.lock \ --mount=type=cache,target=/app/target,sharing=locked \ --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \ - cargo build --features tokio-current-thread --release --locked \ + cargo build --release --locked \ && cp target/release/proxy-scraper-checker . diff --git a/src/main.rs b/src/main.rs index d95fe88..be8ce1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -319,10 +319,13 @@ async fn run_without_tui( } #[cfg_attr( - feature = "tokio-current-thread", + feature = "tokio-multi-thread", + tokio::main(flavor = "multi_thread") +)] +#[cfg_attr( + not(feature = "tokio-multi-thread"), tokio::main(flavor = "current_thread") )] -#[cfg_attr(not(feature = "tokio-current-thread"), tokio::main)] async fn main() -> crate::Result<()> { #[cfg(feature = "dhat")] let _profiler = dhat::Profiler::new_heap();