Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/.checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 10 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}} \
Expand All @@ -70,6 +70,7 @@ tasks:
- "RUSTUP_TOOLCHAIN={{.rust_version}}"
- "RUSTUP_NO_UPDATE_CHECK=1"
- "CARGO_INCREMENTAL=0"
- "RUSTFLAGS=-D warnings"

# ================================================#
# ----------------------PUBLIC--------------------#
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
}
Expand Down
5 changes: 4 additions & 1 deletion src/core/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down