Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-29 06:20:29 +01:00
Added DbConn to /alive healthcheck
During a small discusson on Matrix it seems logical to have the /alive endpoint also check if the database connection still works. The reason for this was regarding a certificate which failed/expired while vaultwarden and the database were still up-and-running, but suddenly vaultwarden couldn't connect anymore. With this `DbConn` added to `/alive`, it will be more accurate, because of vaultwarden can't reach the database, it isn't alive.
Dieser Commit ist enthalten in:
Ursprung
44da9e6ca7
Commit
881524bd54
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
|
@ -64,8 +64,10 @@ fn attachments(uuid: SafeString, file_id: SafeString) -> Option<NamedFile> {
|
||||||
NamedFile::open(Path::new(&CONFIG.attachments_folder()).join(uuid).join(file_id)).ok()
|
NamedFile::open(Path::new(&CONFIG.attachments_folder()).join(uuid).join(file_id)).ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We use DbConn here to let the alive healthcheck also verify the database connection.
|
||||||
|
use crate::db::DbConn;
|
||||||
#[get("/alive")]
|
#[get("/alive")]
|
||||||
fn alive() -> Json<String> {
|
fn alive(_conn: DbConn) -> Json<String> {
|
||||||
use crate::util::format_date;
|
use crate::util::format_date;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
|
||||||
|
|
Laden …
In neuem Issue referenzieren