|
|
@ -101,7 +101,6 @@ impl Device {
|
|
|
|
amr: vec!["Application".into()],
|
|
|
|
amr: vec!["Application".into()],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(encode_jwt(&claims), DEFAULT_VALIDITY.num_seconds())
|
|
|
|
(encode_jwt(&claims), DEFAULT_VALIDITY.num_seconds())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -116,8 +115,15 @@ impl Device {
|
|
|
|
pub fn save(&mut self, conn: &DbConn) -> QueryResult<()> {
|
|
|
|
pub fn save(&mut self, conn: &DbConn) -> QueryResult<()> {
|
|
|
|
self.updated_at = Utc::now().naive_utc();
|
|
|
|
self.updated_at = Utc::now().naive_utc();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
crate::util::retry(
|
|
|
|
|
|
|
|
|| {
|
|
|
|
diesel::replace_into(devices::table)
|
|
|
|
diesel::replace_into(devices::table)
|
|
|
|
.values(&*self).execute(&**conn).and(Ok(()))
|
|
|
|
.values(&*self)
|
|
|
|
|
|
|
|
.execute(&**conn)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
10,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.and(Ok(()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn delete(self, conn: &DbConn) -> QueryResult<()> {
|
|
|
|
pub fn delete(self, conn: &DbConn) -> QueryResult<()> {
|
|
|
|