Compare commits
4 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | cce0afe694 | |
Derrick Hammer | bda8007cdf | |
Derrick Hammer | 9e03b62a59 | |
Derrick Hammer | f306ee2166 |
|
@ -1,3 +1,5 @@
|
|||
# [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)
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/libs5",
|
||||
"version": "0.1.0-develop.18",
|
||||
"version": "0.1.0-develop.19",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/libs5",
|
||||
"version": "0.1.0-develop.18",
|
||||
"version": "0.1.0-develop.19",
|
||||
"dependencies": {
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/libs5",
|
||||
"version": "0.1.0-develop.18",
|
||||
"version": "0.1.0-develop.19",
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
|
|
|
@ -136,7 +136,7 @@ export class RegistryService {
|
|||
return res;
|
||||
}
|
||||
this.sendRegistryRequest(pk);
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
await pTimeout(200);
|
||||
return this.getFromDB(pk);
|
||||
} else {
|
||||
this.sendRegistryRequest(pk);
|
||||
|
@ -145,12 +145,14 @@ export class RegistryService {
|
|||
if (res === null) {
|
||||
this.logger.verbose(`[registry] get (clean) ${key}`);
|
||||
for (let i = 0; i < 200; i++) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 10));
|
||||
if ((await this.getFromDB(pk)) !== null) break;
|
||||
await pTimeout(10);
|
||||
if ((await this.getFromDB(pk)) !== null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.logger.verbose(`[registry] get (cached) ${key}`);
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
await pTimeout(200);
|
||||
}
|
||||
return this.getFromDB(pk);
|
||||
}
|
||||
|
@ -238,3 +240,7 @@ export class RegistryService {
|
|||
]);
|
||||
}
|
||||
}
|
||||
|
||||
async function pTimeout(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue