[VOL-5576]:clear flow cache after reverting flow from adapter

Change-Id: I802f31a2109495e4e00e75f4e75ec69468625d46
Signed-off-by: balaji.nagarajan <balaji.nagarajan@radisys.com>
diff --git a/VERSION b/VERSION
index a0fc9e0..c77a7de 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.7.8
+3.7.9
diff --git a/rw_core/core/device/logical_agent_flow.go b/rw_core/core/device/logical_agent_flow.go
index 642b3d9..5b0fd78 100644
--- a/rw_core/core/device/logical_agent_flow.go
+++ b/rw_core/core/device/logical_agent_flow.go
@@ -239,6 +239,14 @@
 	}
 	defer flowHandle.Unlock()
 
+	// Revert meters
+	if changedMeterStats := agent.updateFlowCountOfMeterStats(ctx, mod, addedFlow, true); !changedMeterStats {
+		return fmt.Errorf("Unable-to-revert-meterstats-for-flow-%s", strconv.FormatUint(addedFlow.Id, 10))
+	}
+
+	// Update the devices
+	respChnls := agent.deleteFlowsAndGroupsFromDevices(ctx, deviceRules, mod)
+
 	if replacedFlow != nil {
 		if err := flowHandle.Update(ctx, replacedFlow); err != nil {
 			return err
@@ -249,14 +257,6 @@
 		}
 	}
 
-	// Revert meters
-	if changedMeterStats := agent.updateFlowCountOfMeterStats(ctx, mod, addedFlow, true); !changedMeterStats {
-		return fmt.Errorf("Unable-to-revert-meterstats-for-flow-%s", strconv.FormatUint(addedFlow.Id, 10))
-	}
-
-	// Update the devices
-	respChnls := agent.deleteFlowsAndGroupsFromDevices(ctx, deviceRules, mod)
-
 	// Wait for the responses
 
 	// Since this action is taken following an add failure, we may also receive a failure for the revert