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 _guard = lock.lock().await;
let mut archs = db::Package::find()
let archs: Vec<String> = db::Package::find()
.filter(db::package::Column::RepoId.eq(repo))
.select_only()
.column(db::package::Column::Arch)
.distinct()
.into_tuple::<String>()
.stream(&self.conn)
.into_tuple()
.all(&self.conn)
.await?;
while let Some(arch) = archs.next().await.transpose()? {
for arch in archs {
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?;
}
writer.flush().await?;
Ok(())
}
@ -417,5 +419,7 @@ pub async fn write_files<W: AsyncWrite + std::marker::Unpin>(
.await?;
}
writer.flush().await?;
Ok(())
}