Skip to content

Commit

Permalink
Merge pull request #956 from matrix-org/dbkr/resurrect_riot_bot
Browse files Browse the repository at this point in the history
Add flag to force saving sync store
  • Loading branch information
dbkr authored Jun 14, 2019
2 parents 0121bdb + 44bfc2e commit efbdf4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/store/indexeddb.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ IndexedDBStore.prototype.wantsSave = function() {

/**
* Possibly write data to the database.
*
* @param {bool} force True to force a save to happen
* @return {Promise} Promise resolves after the write completes
* (or immediately if no write is performed)
*/
IndexedDBStore.prototype.save = function() {
if (this.wantsSave()) {
IndexedDBStore.prototype.save = function(force) {
if (force || this.wantsSave()) {
return this._reallySave();
}
return Promise.resolve();
Expand Down
4 changes: 3 additions & 1 deletion src/store/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,10 @@ module.exports.MemoryStore.prototype = {

/**
* Save does nothing as there is no backing data store.
* @param {bool} force True to force a save (but the memory
* store still can't save anything)
*/
save: function() {},
save: function(force) {},

/**
* Startup does nothing as this store doesn't require starting up.
Expand Down

0 comments on commit efbdf4e

Please sign in to comment.