Remove use of feature flags originating in upstream provided example. Remove unneeded main function.
This commit is contained in:
parent
f0ab3a274b
commit
e8e2319a68
1 changed files with 0 additions and 7 deletions
|
@ -5,7 +5,6 @@ use tracing::{error, info, warn};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
pub async fn run_example(sched: &mut JobScheduler) -> Result<Vec<Uuid>, JobSchedulerError> {
|
pub async fn run_example(sched: &mut JobScheduler) -> Result<Vec<Uuid>, JobSchedulerError> {
|
||||||
#[cfg(feature = "signal")]
|
|
||||||
sched.shutdown_on_ctrl_c();
|
sched.shutdown_on_ctrl_c();
|
||||||
|
|
||||||
sched.set_shutdown_handler(Box::new(|| {
|
sched.set_shutdown_handler(Box::new(|| {
|
||||||
|
@ -181,7 +180,6 @@ pub async fn run_example(sched: &mut JobScheduler) -> Result<Vec<Uuid>, JobSched
|
||||||
let jhb_job_guid = jhb_job.guid();
|
let jhb_job_guid = jhb_job.guid();
|
||||||
sched.add(jhb_job).await.unwrap();
|
sched.add(jhb_job).await.unwrap();
|
||||||
|
|
||||||
#[cfg(feature = "english")]
|
|
||||||
let english_job_guid = {
|
let english_job_guid = {
|
||||||
let english_job = JobBuilder::new()
|
let english_job = JobBuilder::new()
|
||||||
.with_timezone(Utc)
|
.with_timezone(Utc)
|
||||||
|
@ -220,7 +218,6 @@ pub async fn run_example(sched: &mut JobScheduler) -> Result<Vec<Uuid>, JobSched
|
||||||
jja_guid,
|
jja_guid,
|
||||||
utc_job_guid,
|
utc_job_guid,
|
||||||
jhb_job_guid,
|
jhb_job_guid,
|
||||||
#[cfg(feature = "english")]
|
|
||||||
english_job_guid,
|
english_job_guid,
|
||||||
];
|
];
|
||||||
Ok(ret)
|
Ok(ret)
|
||||||
|
@ -243,10 +240,6 @@ pub async fn stop_example(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
|
||||||
eprintln!("Should not be run on its own.");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use tokio_cron_scheduler::{Job, JobScheduler};
|
use tokio_cron_scheduler::{Job, JobScheduler};
|
||||||
|
|
Loading…
Add table
Reference in a new issue