feature-token
This commit is contained in:
parent
c1908eceeb
commit
a358eebbc9
|
|
@ -26,8 +26,9 @@ var Token = /** @class */ (function (_super) {
|
||||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||||
return tslib_1.__generator(this, function (_a) {
|
return tslib_1.__generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0: return [4 /*yield*/, this.rwLock.acquire('X')];
|
||||||
this.rwLock.acquire('X');
|
case 1:
|
||||||
|
_a.sent();
|
||||||
return [4 /*yield*/, this.cache.refresh('token', {
|
return [4 /*yield*/, this.cache.refresh('token', {
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|
@ -49,7 +50,7 @@ var Token = /** @class */ (function (_super) {
|
||||||
id: this.token,
|
id: this.token,
|
||||||
},
|
},
|
||||||
})];
|
})];
|
||||||
case 1:
|
case 2:
|
||||||
_a.sent();
|
_a.sent();
|
||||||
this.rwLock.release();
|
this.rwLock.release();
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export class Token<
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadTokenInfo() {
|
async loadTokenInfo() {
|
||||||
this.rwLock.acquire('X');
|
await this.rwLock.acquire('X');
|
||||||
await this.cache.refresh('token', {
|
await this.cache.refresh('token', {
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue