Loading src/pathcompextended/service/PathCompExtendedServiceServicerImpl.py +6 −16 Original line number Diff line number Diff line Loading @@ -95,20 +95,10 @@ class PathCompExtendedServiceServicerImpl(PathCompExtendedServiceServicer): for topology in request.topologies ]) # Apply hash to track network state changes network_hash = hashlib.sha256( json.dumps(hrat_request.model_dump(by_alias=True, exclude_none=True), sort_keys=True).encode() ).hexdigest() must_send_context = network_hash != self._last_network_hash if must_send_context: LOGGER.debug("Network state changed, updating HRAT network context") LOGGER.debug("Updating network context on H-RAT") with self._lock: hrat_response = self._hrat_client.network_context(hrat_request) self._last_network_hash = network_hash LOGGER.debug("HRAT network context updated successfully: {:s}".format(hrat_response.message)) else: LOGGER.debug("Network state unchanged, skipping HRAT context update") except Exception as e: LOGGER.error('[CreateNetworkContext] Error sending context to H-RAT: {:s}'.format(str(e))) Loading Loading
src/pathcompextended/service/PathCompExtendedServiceServicerImpl.py +6 −16 Original line number Diff line number Diff line Loading @@ -95,20 +95,10 @@ class PathCompExtendedServiceServicerImpl(PathCompExtendedServiceServicer): for topology in request.topologies ]) # Apply hash to track network state changes network_hash = hashlib.sha256( json.dumps(hrat_request.model_dump(by_alias=True, exclude_none=True), sort_keys=True).encode() ).hexdigest() must_send_context = network_hash != self._last_network_hash if must_send_context: LOGGER.debug("Network state changed, updating HRAT network context") LOGGER.debug("Updating network context on H-RAT") with self._lock: hrat_response = self._hrat_client.network_context(hrat_request) self._last_network_hash = network_hash LOGGER.debug("HRAT network context updated successfully: {:s}".format(hrat_response.message)) else: LOGGER.debug("Network state unchanged, skipping HRAT context update") except Exception as e: LOGGER.error('[CreateNetworkContext] Error sending context to H-RAT: {:s}'.format(str(e))) Loading