Skip to content

Commit

Permalink
Amendment in the previous correction to the forecasting termination p…
Browse files Browse the repository at this point in the history
…rocess
  • Loading branch information
atsag committed Oct 8, 2024
1 parent f92de61 commit 071aa81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exponential-smoothing-predictor/src/runtime/Predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,12 @@ def on_message(self, key, address, body, context, **kwargs):
application_name = body["name"]
application_state = EsPredictorState.individual_application_state[application_name]
print_with_time("Received message to stop predicting some of the metrics")
metrics_to_remove = json.loads(body)["metrics"]
metrics_to_remove = body["metrics"]
for metric in metrics_to_remove:
if (application_state.metrics_to_predict.__contains__(metric)):
print_with_time("Stopping generating predictions for metric "+metric)
application_state.metrics_to_predict.remove(metric)
if len(application_state.metrics_to_predict)==0:
if (len(metrics_to_remove)==0 or len(application_state.metrics_to_predict)==0):
EsPredictorState.individual_application_state[application_name].start_forecasting = False
EsPredictorState[application_name].prediction_thread.join()

Expand Down

0 comments on commit 071aa81

Please sign in to comment.