Skip to content

Commit

Permalink
Use await for updating settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbinf committed Feb 14, 2023
1 parent b8d2382 commit 5ca1d3f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions edge-src/models/FeedDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,8 @@ export default class FeedDb {
data: JSON.stringify(settings[category]),
},
).run();
console.log('finished updating successfully')
} catch (error) {
try {
console.log('Failed to update for ', category, error);
} catch (e) {
console.log('exception inside catch for update')
}
} finally {
console.log('finally for update')
console.log('Failed to update for ', category, error);
}
try {
console.log('Trying to insert...', category);
Expand All @@ -397,9 +390,9 @@ export default class FeedDb {
}

async _putSettingsToContent(settings) {
Object.keys(settings).forEach((category) => {
this._updateOrAddSetting(settings, category);
});
for (const category of Object.keys(settings)) {
await this._updateOrAddSetting(settings, category);
}
}

async _putItemToContent(item) {
Expand Down

0 comments on commit 5ca1d3f

Please sign in to comment.