fix: flush desc files explicitely

concurrent-repos
Jef Roosens 2024-06-17 22:59:54 +02:00
parent 97e42588ed
commit cc8848d3ae
Signed by: Jef Roosens
GPG Key ID: 02D4C0997E74717B
2 changed files with 8 additions and 4 deletions

View File

@ -84,16 +84,16 @@ impl RepoMgr {
let lock = lock.unwrap(); let lock = lock.unwrap();
let _guard = lock.lock().await; let _guard = lock.lock().await;
let mut archs = db::Package::find() let archs: Vec<String> = db::Package::find()
.filter(db::package::Column::RepoId.eq(repo)) .filter(db::package::Column::RepoId.eq(repo))
.select_only() .select_only()
.column(db::package::Column::Arch) .column(db::package::Column::Arch)
.distinct() .distinct()
.into_tuple::<String>() .into_tuple()
.stream(&self.conn) .all(&self.conn)
.await?; .await?;
while let Some(arch) = archs.next().await.transpose()? { for arch in archs {
self.generate_archives(repo, &arch).await?; self.generate_archives(repo, &arch).await?;
} }

View File

@ -397,6 +397,8 @@ pub async fn write_desc<W: AsyncWrite + std::marker::Unpin>(
write_attribute(writer, key, &items.join("\n")).await?; write_attribute(writer, key, &items.join("\n")).await?;
} }
writer.flush().await?;
Ok(()) Ok(())
} }
@ -417,5 +419,7 @@ pub async fn write_files<W: AsyncWrite + std::marker::Unpin>(
.await?; .await?;
} }
writer.flush().await?;
Ok(()) Ok(())
} }