feat: move match scrutinee
This commit is contained in:
parent
bfd5596993
commit
2fd1201615
@ -71,10 +71,11 @@ impl ScheduleJob {
|
|||||||
|
|
||||||
#[instrument(skip(self))]
|
#[instrument(skip(self))]
|
||||||
pub async fn add_cron_job(&mut self, server_id: u64, channel_id: u64, cron_expression: String) {
|
pub async fn add_cron_job(&mut self, server_id: u64, channel_id: u64, cron_expression: String) {
|
||||||
let job = match Job::new(cron_expression.as_str(), move |uuid, _l| {
|
let job_fn = move |uuid, _l| {
|
||||||
// Do something
|
// Do something
|
||||||
info!("Cron job executed with id: {:?}", uuid);
|
info!("Cron job executed with id: {:?}", uuid);
|
||||||
}) {
|
};
|
||||||
|
let job = match Job::new(cron_expression.as_str(), job_fn) {
|
||||||
Ok(job) => job,
|
Ok(job) => job,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Error creating cron job: {:?}", e);
|
error!("Error creating cron job: {:?}", e);
|
||||||
|
Loading…
Reference in New Issue
Block a user