Commit 098e1d4d authored by nanahira's avatar nanahira

put mirror feature back

parent 075d0d39
Pipeline #14455 passed with stages
in 4 minutes and 17 seconds
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
"busboy": "^0.2.14", "busboy": "^0.2.14",
"class-transformer": "^0.4.0", "class-transformer": "^0.4.0",
"class-validator": "^0.13.1", "class-validator": "^0.13.1",
"delay": "^5.0.0",
"ioredis": "^4.28.5", "ioredis": "^4.28.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.1", "moment": "^2.29.1",
...@@ -4829,6 +4830,17 @@ ...@@ -4829,6 +4830,17 @@
"clone": "^1.0.2" "clone": "^1.0.2"
} }
}, },
"node_modules/delay": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
"integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/delayed-stream": { "node_modules/delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
...@@ -15348,6 +15360,11 @@ ...@@ -15348,6 +15360,11 @@
"clone": "^1.0.2" "clone": "^1.0.2"
} }
}, },
"delay": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
"integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw=="
},
"delayed-stream": { "delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
"busboy": "^0.2.14", "busboy": "^0.2.14",
"class-transformer": "^0.4.0", "class-transformer": "^0.4.0",
"class-validator": "^0.13.1", "class-validator": "^0.13.1",
"delay": "^5.0.0",
"ioredis": "^4.28.5", "ioredis": "^4.28.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.1", "moment": "^2.29.1",
......
...@@ -143,7 +143,7 @@ export class UpdateService extends ConsoleLogger { ...@@ -143,7 +143,7 @@ export class UpdateService extends ConsoleLogger {
const archives = await this.getArchives(id, depotDto, version, (qb) => const archives = await this.getArchives(id, depotDto, version, (qb) =>
qb.select(['archive.hash', 'archive.path', 'archive.size']).andWhere('archive.role = :fullRole', { fullRole: ArchiveType.Full }) qb.select(['archive.hash', 'archive.path', 'archive.size']).andWhere('archive.role = :fullRole', { fullRole: ArchiveType.Full })
); );
//await this.mirror.lookForArchivesMirror(archives); await this.mirror.lookForArchivesMirror(archives);
return { return {
cdnUrl: this.cdnUrl, cdnUrl: this.cdnUrl,
archives: archives, archives: archives,
...@@ -310,7 +310,7 @@ export class UpdateService extends ConsoleLogger { ...@@ -310,7 +310,7 @@ export class UpdateService extends ConsoleLogger {
if (!allPartArchives.length || (fullArchive && this.getCostOfArchives([fullArchive]) <= this.getCostOfArchives(allPartArchives))) { if (!allPartArchives.length || (fullArchive && this.getCostOfArchives([fullArchive]) <= this.getCostOfArchives(allPartArchives))) {
archives = [fullArchive]; archives = [fullArchive];
} }
// await this.mirror.lookForArchivesMirror(archives); await this.mirror.lookForArchivesMirror(archives);
//this.log(`Time used: ${moment().diff(clock, 'seconds')} s`); //this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
return { return {
cdnUrl: this.cdnUrl, cdnUrl: this.cdnUrl,
......
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