From 0c0d31208f0a634a761f5da6a8794bcdbbeae4c4 Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Fri, 31 Oct 2025 10:57:00 +0400 Subject: [PATCH 1/2] add cargo check flow --- .github/workflows/.checks.yml | 8 ++++++++ Taskfile.yml | 11 ++++++++++- src/core/supervisor.rs | 5 ++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/.checks.yml b/.github/workflows/.checks.yml index 41bce08..bed60e3 100644 --- a/.github/workflows/.checks.yml +++ b/.github/workflows/.checks.yml @@ -11,6 +11,14 @@ jobs: uses: soltiHQ/actions/taskfile@main with: { command: cargo/fmt } + check: + runs-on: ${{ vars.RUNS_ON }} + steps: + - uses: actions/checkout@v4 + - name: Run check + uses: soltiHQ/actions/taskfile@main + with: { command: cargo/check } + test: runs-on: ${{ vars.RUNS_ON }} steps: diff --git a/Taskfile.yml b/Taskfile.yml index b82a474..4eeed85 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -43,7 +43,7 @@ tasks: \ --volume "{{.git_root}}/{{.MOUNT_DIR}}:/workspace:rw" \ {{if .VOLUMES}}{{range $vol := .VOLUMES}}--volume {{$vol}} {{end}}{{end}} \ - {{if .ENVS}}{{range $env := .ENVS}}--env {{$env}} {{end}}{{end}} \ + {{if .ENVS}}{{range $env := .ENVS}}--env "{{$env}}" {{end}}{{end}} \ \ --workdir /workspace \ {{.IMAGE}} \ @@ -70,6 +70,7 @@ tasks: - "RUSTUP_TOOLCHAIN={{.rust_version}}" - "RUSTUP_NO_UPDATE_CHECK=1" - "CARGO_INCREMENTAL=0" + - "RUSTFLAGS=-D warnings" # ================================================# # ----------------------PUBLIC--------------------# @@ -83,6 +84,14 @@ tasks: vars: CMD: "fmt --check --verbose" + cargo/check: + desc: Run 'cargo check'. + silent: true + cmds: + - task: _cargo/tool + vars: + CMD: "check" + cargo/clippy: desc: Run 'cargo clippy'. silent: true diff --git a/src/core/supervisor.rs b/src/core/supervisor.rs index 0118bf2..75d7195 100644 --- a/src/core/supervisor.rs +++ b/src/core/supervisor.rs @@ -91,9 +91,12 @@ //! ``` use std::{sync::Arc, time::Duration}; -use tokio::{sync::Notify, sync::OnceCell, sync::broadcast, time::timeout}; +use tokio::{sync::Notify, sync::broadcast, time::timeout}; use tokio_util::sync::CancellationToken; +#[cfg(feature = "controller")] +use tokio::sync::OnceCell; + use crate::core::{alive::AliveTracker, builder::SupervisorBuilder, registry::Registry}; use crate::{ config::Config, From 3da788ca386f7cd1c4500d95acc22ccd968bdb8f Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Fri, 31 Oct 2025 10:59:00 +0400 Subject: [PATCH 2/2] remove unused var --- examples/controller.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/controller.rs b/examples/controller.rs index 60b5116..65662de 100644 --- a/examples/controller.rs +++ b/examples/controller.rs @@ -60,7 +60,7 @@ async fn main() -> anyhow::Result<()> { println!("Demo 1: Queue Policy"); println!(" └► Submit 3 tasks with same name: they run sequentially"); - for i in 1..=3 { + for _ in 1..=3 { let spec = make_spec("job-in-queue", 800); sup.submit(ControllerSpec::queue(spec)).await?; }