Add option to force resync clients in admin panel

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

No files matched your search

+14
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();