Skip to content

Commit

Permalink
chore: add error log
Browse files Browse the repository at this point in the history
  • Loading branch information
Flrande committed May 2, 2024
1 parent 66665b3 commit e8cfbba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/framework/sync/src/blob/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export class BlobEngine {
const data = await this.main.get(key);
if (data) {
await shadow.set(key, data);
} else {
this.logger.error(
'data not found when trying upload from main to shadow'
);
}
} catch (err) {
this.logger.error(
Expand All @@ -91,12 +95,15 @@ export class BlobEngine {
}

const needDownload = shadowList.filter(key => !mainList.includes(key));

for (const key of needDownload) {
try {
const data = await shadow.get(key);
if (data) {
await this.main.set(key, data);
} else {
this.logger.error(
'data not found when trying download from shadow to main'
);
}
} catch (err) {
this.logger.error(
Expand Down

0 comments on commit e8cfbba

Please sign in to comment.