[Fleet] Fix unpackBufferToCache to avoid getting cache in a non valid state (#173201)

This commit is contained in:
Nicolas Chaulet 2023-12-13 09:19:16 -05:00 committed by GitHub
parent 4936d8c6f1
commit 3fbd25ba3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,10 +45,10 @@ export async function unpackBufferToCache({
contentType: string;
archiveBuffer: Buffer;
}): Promise<string[]> {
const entries = await unpackBufferEntries(archiveBuffer, contentType);
// Make sure any buffers from previous installations from registry or upload are deleted first
clearPackageFileCache({ name, version });
const entries = await unpackBufferEntries(archiveBuffer, contentType);
const paths: string[] = [];
entries.forEach((entry) => {
const { path, buffer } = entry;