Commit c62b2392 authored by nanahira's avatar nanahira

dont put check hash in queue

parent 46c72c45
Pipeline #15368 passed with stages
in 4 minutes and 47 seconds
...@@ -209,9 +209,7 @@ export class PackagerService extends ConsoleLogger { ...@@ -209,9 +209,7 @@ export class PackagerService extends ConsoleLogger {
} }
async archive(root: string, archiveTask: ArchiveTask): Promise<Archive> { async archive(root: string, archiveTask: ArchiveTask): Promise<Archive> {
return this.redlock.using([`archive:${archiveTask.path}`], 5000, async () => return this.redlock.using([`archive:${archiveTask.path}`], 5000, async () => this.archiveProcess(root, archiveTask));
this.archiveQueue.add(() => this.archiveProcess(root, archiveTask))
);
} }
private archiveQueue = new PQueue({ concurrency: parseInt(process.env.PACKAGE_COCURRENCY) || os.cpus().length }); private archiveQueue = new PQueue({ concurrency: parseInt(process.env.PACKAGE_COCURRENCY) || os.cpus().length });
...@@ -229,6 +227,7 @@ export class PackagerService extends ConsoleLogger { ...@@ -229,6 +227,7 @@ export class PackagerService extends ConsoleLogger {
return archive; return archive;
} }
} }
return this.archiveQueue.add(async () => {
const files = archiveTask.filePaths; const files = archiveTask.filePaths;
this.log(`Packaging archive ${archiveName} with ${archiveTask.exactFilePaths.length} files.`); this.log(`Packaging archive ${archiveName} with ${archiveTask.exactFilePaths.length} files.`);
...@@ -265,6 +264,7 @@ export class PackagerService extends ConsoleLogger { ...@@ -265,6 +264,7 @@ export class PackagerService extends ConsoleLogger {
archive.size = object.Size; archive.size = object.Size;
return archive; return archive;
});
} }
private spawnAsync(command: string, args: string[], options: child_process.SpawnOptions, stdinStream?: NodeJS.ReadableStream) { private spawnAsync(command: string, args: string[], options: child_process.SpawnOptions, stdinStream?: NodeJS.ReadableStream) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment