Add option to force resync clients in admin panel

This commit is contained in:
Daniel García
2019-03-07 21:08:33 +01:00
parent 27872f476e
commit 43f9038325
3 changed files with 37 additions and 5 deletions

View File

@@ -178,6 +178,20 @@ impl User {
}
}
pub fn update_all_revisions(conn: &DbConn) -> EmptyResult {
let updated_at = Utc::now().naive_utc();
crate::util::retry(
|| {
diesel::update(users::table)
.set(users::updated_at.eq(updated_at))
.execute(&**conn)
},
10,
)
.map_res("Error updating revision date for all users")
}
pub fn update_revision(&mut self, conn: &DbConn) -> EmptyResult {
self.updated_at = Utc::now().naive_utc();