VOL-5219 core should be able to refire the missed reconcile requests
Change-Id: I661e21223a11842478f28349a24a4bb1c35d7c56
diff --git a/rw_core/core/device/manager.go b/rw_core/core/device/manager.go
index 3368749..e098f1e 100755
--- a/rw_core/core/device/manager.go
+++ b/rw_core/core/device/manager.go
@@ -19,6 +19,7 @@
import (
"context"
"fmt"
+ "github.com/opencord/voltha-protos/v5/go/common"
"sync"
"time"
@@ -121,10 +122,11 @@
} else {
dMgr.addDeviceAgentToMap(agent)
}
+ // In case core goes down after it sets the transient state as reconciling but missed to fire the reconcile request to the adaptors, it should refire those reconcile requests on restart
+ if device.OperStatus != common.OperStatus_RECONCILING && (device.OperStatus == common.OperStatus_RECONCILING_FAILED || agent.matchTransientState(core.DeviceTransientState_RECONCILE_IN_PROGRESS)) {
+ go agent.ReconcileDevice(ctx)
+ }
}
-
- // TODO: Need to trigger a reconcile at this point
-
logger.Info(ctx, "device-manager-started")
return nil