Compare commits

..

No commits in common. "v0.1.0-develop.19" and "v0.1.0-develop.18" have entirely different histories.

4 changed files with 7 additions and 15 deletions

View File

@ -1,5 +1,3 @@
# [0.1.0-develop.19](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.18...v0.1.0-develop.19) (2023-09-01)
# [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-09-01) # [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-09-01)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.19", "version": "0.1.0-develop.18",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.19", "version": "0.1.0-develop.18",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.19", "version": "0.1.0-develop.18",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -136,7 +136,7 @@ export class RegistryService {
return res; return res;
} }
this.sendRegistryRequest(pk); this.sendRegistryRequest(pk);
await pTimeout(200); await new Promise((resolve) => setTimeout(resolve, 200));
return this.getFromDB(pk); return this.getFromDB(pk);
} else { } else {
this.sendRegistryRequest(pk); this.sendRegistryRequest(pk);
@ -145,14 +145,12 @@ export class RegistryService {
if (res === null) { if (res === null) {
this.logger.verbose(`[registry] get (clean) ${key}`); this.logger.verbose(`[registry] get (clean) ${key}`);
for (let i = 0; i < 200; i++) { for (let i = 0; i < 200; i++) {
await pTimeout(10); await new Promise((resolve) => setTimeout(resolve, 10));
if ((await this.getFromDB(pk)) !== null) { if ((await this.getFromDB(pk)) !== null) break;
break;
}
} }
} else { } else {
this.logger.verbose(`[registry] get (cached) ${key}`); this.logger.verbose(`[registry] get (cached) ${key}`);
await pTimeout(200); await new Promise((resolve) => setTimeout(resolve, 200));
} }
return this.getFromDB(pk); return this.getFromDB(pk);
} }
@ -240,7 +238,3 @@ export class RegistryService {
]); ]);
} }
} }
async function pTimeout(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}