mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 17:08:57 +00:00
Implement Couch Search and Request Batching (#3798)
* Implemented search in couch provider * Promises, not await * Batch requests * Only batch if > 1 * Remove legacy Couch adapter * Cleaned up couch request batching code * Added test cases * Code cleanup * Changes to new and legacy objects API to remove redundant persists due to mutation of modified and persisted timestamps * Cleaned up couch unit tests Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
This commit is contained in:
@ -76,7 +76,10 @@ class MutableDomainObject {
|
||||
}
|
||||
$set(path, value) {
|
||||
_.set(this, path, value);
|
||||
_.set(this, 'modified', Date.now());
|
||||
|
||||
if (path !== 'persisted' && path !== 'modified') {
|
||||
_.set(this, 'modified', Date.now());
|
||||
}
|
||||
|
||||
//Emit secret synchronization event first, so that all objects are in sync before subsequent events fired.
|
||||
this._globalEventEmitter.emit(qualifiedEventName(this, '$_synchronize_model'), this);
|
||||
|
@ -520,8 +520,10 @@ ObjectAPI.prototype.getOriginalPath = function (identifier, path = []) {
|
||||
*/
|
||||
|
||||
function hasAlreadyBeenPersisted(domainObject) {
|
||||
return domainObject.persisted !== undefined
|
||||
&& domainObject.persisted === domainObject.modified;
|
||||
const result = domainObject.persisted !== undefined
|
||||
&& domainObject.persisted >= domainObject.modified;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export default ObjectAPI;
|
||||
|
Reference in New Issue
Block a user