mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-05 18:43:56 +00:00
Retry updating revision - fixes #383
This commit is contained in:
parent
06522c9ac0
commit
bce656c787
1 changed files with 6 additions and 4 deletions
|
@ -184,10 +184,12 @@ impl User {
|
||||||
|
|
||||||
pub fn update_revision(&mut self, conn: &DbConn) -> EmptyResult {
|
pub fn update_revision(&mut self, conn: &DbConn) -> EmptyResult {
|
||||||
self.updated_at = Utc::now().naive_utc();
|
self.updated_at = Utc::now().naive_utc();
|
||||||
diesel::update(users::table.filter(users::uuid.eq(&self.uuid)))
|
crate::util::retry( || {
|
||||||
.set(users::updated_at.eq(&self.updated_at))
|
diesel::update(users::table.filter(users::uuid.eq(&self.uuid)))
|
||||||
.execute(&**conn)
|
.set(users::updated_at.eq(&self.updated_at))
|
||||||
.map_res("Error updating user revision")
|
.execute(&**conn)
|
||||||
|
}, 10)
|
||||||
|
.map_res("Error updating user revision")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find_by_mail(mail: &str, conn: &DbConn) -> Option<Self> {
|
pub fn find_by_mail(mail: &str, conn: &DbConn) -> Option<Self> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue