Commit f9ce2975 authored by nanahira's avatar nanahira

reverify md5 in upload

parent 6e22506e
Pipeline #40955 passed with stages
in 7 minutes and 16 seconds
...@@ -401,7 +401,7 @@ export class PackagerService extends ConsoleLogger { ...@@ -401,7 +401,7 @@ export class PackagerService extends ConsoleLogger {
archive.hash = hashObject.digest('hex'); archive.hash = hashObject.digest('hex');
const md5 = md5Object.digest('hex'); const md5 = md5Object.digest('hex');
const md5InS3 = await this.s3.getObjectHash(archiveName); const md5InS3 = await this.s3.getObjectHash(archiveName);
if (md5InS3 && md5InS3 !== md5) { if (md5InS3 !== md5) {
throw new Error(`MD5 mismatch for archive ${archiveName}: local ${md5} vs s3 ${md5InS3}`); throw new Error(`MD5 mismatch for archive ${archiveName}: local ${md5} vs s3 ${md5InS3}`);
} }
await this.redis.set(`hash:${archive.path}`, archive.hash, 'EX', 60 * 60 * 24); await this.redis.set(`hash:${archive.path}`, archive.hash, 'EX', 60 * 60 * 24);
......
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