mirror of
https://github.com/flibusta-apps/users_settings_server.git
synced 2025-12-06 14:45:38 +01:00
Fix bug
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
.env
|
.env
|
||||||
|
|
||||||
|
.vscode
|
||||||
|
|
||||||
target
|
target
|
||||||
prisma-cli/target
|
prisma-cli/target
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ async fn is_need_send(
|
|||||||
|
|
||||||
match notification {
|
match notification {
|
||||||
Some(notification) => {
|
Some(notification) => {
|
||||||
let now = chrono::offset::Local::now().naive_local();
|
let result = notification.sended.naive_local() + Duration::days(NOTIFICATION_DELTA_DAYS) <= chrono::offset::Local::now().naive_local();
|
||||||
let check_date = now - Duration::days(NOTIFICATION_DELTA_DAYS);
|
|
||||||
let result = notification.sended.naive_local() < check_date;
|
|
||||||
|
|
||||||
Json(result).into_response()
|
Json(result).into_response()
|
||||||
},
|
},
|
||||||
None => Json(true).into_response(),
|
None => Json(true).into_response(),
|
||||||
@@ -48,7 +45,9 @@ async fn mark_sended(
|
|||||||
chrono::offset::Local::now().into()
|
chrono::offset::Local::now().into()
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
);
|
)
|
||||||
|
.exec()
|
||||||
|
.await;
|
||||||
|
|
||||||
StatusCode::OK
|
StatusCode::OK
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user