将cache中的回调放在syncRecord之前执行,可能有影响

This commit is contained in:
Xu Chang 2023-12-08 12:30:54 +08:00
parent aaccbda3bc
commit 83cf73b5bc
3 changed files with 3 additions and 3 deletions

View File

@ -81,11 +81,11 @@ export class Cache extends Feature {
try { try {
this.refreshing++; this.refreshing++;
const { result, opRecords, message } = await this.aspectWrapper.exec(name, params); const { result, opRecords, message } = await this.aspectWrapper.exec(name, params);
callback && callback(result, opRecords);
if (opRecords) { if (opRecords) {
this.syncInner(opRecords); this.syncInner(opRecords);
} }
this.refreshing--; this.refreshing--;
callback && callback(result, opRecords);
if (opRecords && opRecords.length > 0 && !dontPublish) { if (opRecords && opRecords.length > 0 && !dontPublish) {
this.publish(); this.publish();
} }

View File

@ -84,11 +84,11 @@ class Cache extends Feature_1.Feature {
try { try {
this.refreshing++; this.refreshing++;
const { result, opRecords, message } = await this.aspectWrapper.exec(name, params); const { result, opRecords, message } = await this.aspectWrapper.exec(name, params);
callback && callback(result, opRecords);
if (opRecords) { if (opRecords) {
this.syncInner(opRecords); this.syncInner(opRecords);
} }
this.refreshing--; this.refreshing--;
callback && callback(result, opRecords);
if (opRecords && opRecords.length > 0 && !dontPublish) { if (opRecords && opRecords.length > 0 && !dontPublish) {
this.publish(); this.publish();
} }

View File

@ -149,11 +149,11 @@ export class Cache<
try { try {
this.refreshing++; this.refreshing++;
const { result, opRecords, message } = await this.aspectWrapper.exec(name, params); const { result, opRecords, message } = await this.aspectWrapper.exec(name, params);
callback && callback(result, opRecords);
if (opRecords) { if (opRecords) {
this.syncInner(opRecords); this.syncInner(opRecords);
} }
this.refreshing--; this.refreshing--;
callback && callback(result, opRecords);
if (opRecords && opRecords.length > 0 && !dontPublish) { if (opRecords && opRecords.length > 0 && !dontPublish) {
this.publish(); this.publish();
} }