Skip to content

Commit

Permalink
fix: type definition error
Browse files Browse the repository at this point in the history
  • Loading branch information
AH-dark committed Jul 6, 2024
1 parent 1111991 commit 7d5fb13
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "distributed-scheduler"
description = "A distributed cronjob library"
version = "2.0.0"
version = "2.0.1"
edition = "2021"
repository = "https://github.com/AH-dark/distributed-scheduler.git"
homepage = "https://github.com/AH-dark/distributed-scheduler"
Expand Down
6 changes: 4 additions & 2 deletions src/cron.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::HashMap;
use std::future::Future;
use std::sync::Arc;

use job_scheduler::{Schedule, Uuid};
Expand Down Expand Up @@ -102,9 +103,10 @@ impl<'a> Cron<'a> {
/// * `schedule` - The schedule of the job
/// * `run` - The async function to run
///
pub async fn add_async_job<F>(&self, job_name: &str, schedule: Schedule, run: F) -> Result<(), Error>
pub async fn add_async_job<F, Fut>(&self, job_name: &str, schedule: Schedule, run: F) -> Result<(), Error>
where
F: 'static + Sync + Send + Fn() -> tokio::task::JoinHandle<()>,
F: 'static + Sync + Send + Fn() -> Fut,
Fut: Future<Output=Result<(), Box<dyn std::error::Error>>> + Send,
{
let run = Arc::new(run);

Expand Down

0 comments on commit 7d5fb13

Please sign in to comment.