diff --git a/src/queue/payouts.rs b/src/queue/payouts.rs index 4f3f9ddd1..904aad39e 100644 --- a/src/queue/payouts.rs +++ b/src/queue/payouts.rs @@ -207,7 +207,7 @@ pub async fn process_payout( client: &clickhouse::Client, ) -> Result<(), ApiError> { let start: DateTime = DateTime::from_utc( - Utc::now() + (Utc::now() - Duration::days(1)) .date_naive() .and_hms_nano_opt(0, 0, 0, 0) .unwrap_or_default(), diff --git a/src/routes/v2/version_file.rs b/src/routes/v2/version_file.rs index 06bde8456..569f8935b 100644 --- a/src/routes/v2/version_file.rs +++ b/src/routes/v2/version_file.rs @@ -305,7 +305,7 @@ pub async fn get_update_from_hash( bool }) - .sorted_by(|a, b| b.inner.date_published.cmp(&a.inner.date_published)) + .sorted_by(|a, b| a.inner.date_published.cmp(&b.inner.date_published)) .collect::>(); if let Some(first) = versions.pop() { @@ -484,6 +484,7 @@ pub async fn update_files( for file in files.iter().filter(|x| x.project_id == project.inner.id) { let version = all_versions .iter() + .filter(|x| x.inner.project_id == file.project_id) .filter(|x| { let mut bool = true; @@ -589,6 +590,7 @@ pub async fn update_individual_files( if let Some(query_file) = update_data.hashes.iter().find(|x| &x.hash == hash) { let version = all_versions .iter() + .filter(|x| x.inner.project_id == file.project_id) .filter(|x| { let mut bool = true;