mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 13:18:15 +00:00
[Persistence] Break promise cycle
Break cyclical dependency in Promises that was causing persistence to fall into an unresolvable state after overwrite, WTD-1033.
This commit is contained in:
@ -18,9 +18,13 @@ define(
|
|||||||
function persist(failure) {
|
function persist(failure) {
|
||||||
var decoratedPersistence =
|
var decoratedPersistence =
|
||||||
failure.domainObject.getCapability('persistence');
|
failure.domainObject.getCapability('persistence');
|
||||||
return decoratedPersistence &&
|
// Note that we issue the persist request here, but don't
|
||||||
|
// return it. We trust that the PersistenceQueue will
|
||||||
|
// behave correctly on the next round of flushing.
|
||||||
|
if (decoratedPersistence) {
|
||||||
decoratedPersistence.persist();
|
decoratedPersistence.persist();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Retry persistence (overwrite) for this set of failed attempts
|
// Retry persistence (overwrite) for this set of failed attempts
|
||||||
function retry(failures) {
|
function retry(failures) {
|
||||||
|
@ -50,7 +50,8 @@ define(
|
|||||||
// Handle any failures from the full operation
|
// Handle any failures from the full operation
|
||||||
function handleFailure(value) {
|
function handleFailure(value) {
|
||||||
return failures.length > 0 ?
|
return failures.length > 0 ?
|
||||||
failureHandler.handle(failures) : value;
|
failureHandler.handle(failures) :
|
||||||
|
value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to persist everything, then handle any failures
|
// Try to persist everything, then handle any failures
|
||||||
|
Reference in New Issue
Block a user