fix: update oldest first

This commit is contained in:
Anna 2022-08-13 18:01:40 -04:00
parent 4d7988d136
commit e3adfaf545
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0

View File

@ -37,7 +37,7 @@ pub fn spawn(state: Arc<RwLock<State>>) -> JoinHandle<()> {
async fn inner(state: &RwLock<State>, lodestone: &LodestoneScraper) -> Result<HashMap<u32, Result<()>>> { async fn inner(state: &RwLock<State>, lodestone: &LodestoneScraper) -> Result<HashMap<u32, Result<()>>> {
let users = sqlx::query!( let users = sqlx::query!(
// language=sqlite // language=sqlite
"select * from users where (julianday(current_timestamp) - julianday(last_updated)) * 24 >= 2", "select * from users where (julianday(current_timestamp) - julianday(last_updated)) * 24 >= 2 order by last_updated",
) )
.fetch_all(&state.read().await.db) .fetch_all(&state.read().await.db)
.await .await