Skip to content
Snippets Groups Projects
Commit bb4f8ea4 authored by Lei Xu's avatar Lei Xu
Browse files

fix concurrency issue in Statistics

parent 1658c15b
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ public class BandwidthResource extends ServerResource {
//fix concurrency scenario
IOFSwitch sw = switchService.getSwitch(dpid);
if (sw == null){
return Collections.singletonMap("ERROR", "Switch was not online: " + dpid);
return Collections.singletonMap("ERROR", "Switch was not online: " + dpid);
}
for (OFPortDesc pd : sw.getPorts()) { /* do specific DPID; do all ports */
SwitchPortBandwidth spb = statisticsService.getBandwidthConsumption(dpid, pd.getPortNo());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment