diff --git a/.gitignore b/.gitignore index a0474f4..203cff6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .env +.vscode + target prisma-cli/target diff --git a/src/views/donate_notifications.rs b/src/views/donate_notifications.rs index eb7de80..2f3f252 100644 --- a/src/views/donate_notifications.rs +++ b/src/views/donate_notifications.rs @@ -20,10 +20,7 @@ async fn is_need_send( match notification { Some(notification) => { - let now = chrono::offset::Local::now().naive_local(); - let check_date = now - Duration::days(NOTIFICATION_DELTA_DAYS); - let result = notification.sended.naive_local() < check_date; - + let result = notification.sended.naive_local() + Duration::days(NOTIFICATION_DELTA_DAYS) <= chrono::offset::Local::now().naive_local(); Json(result).into_response() }, None => Json(true).into_response(), @@ -48,7 +45,9 @@ async fn mark_sended( chrono::offset::Local::now().into() ) ] - ); + ) + .exec() + .await; StatusCode::OK }