Commit 72f44ed2 authored by Diana Jlailaty's avatar Diana Jlailaty
Browse files

Fixing connection issue in Prophet and FileNotFound in Gluonmachines

parent 9b726057
Pipeline #17437 passed with stage
in 1 minute and 47 seconds
......@@ -104,9 +104,9 @@ class Gluonts(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
#self.model = morphemic.model.Model(self)
def run(self):
logging.debug("setting up")
sleep(180)
logging.debug("starting the connection to ActiveMQ")
#logging.debug("setting up")
#sleep(180)
#logging.debug("starting the connection to ActiveMQ")
self.connector.connect()
self.connector.set_listener(self.id, self)
self.connector.topic("start_forecasting.gluonmachines", self.id)
......@@ -132,7 +132,7 @@ class Gluonts(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
def on_metrics_to_predict(self, body):
dataset_preprocessor = CSVData(APP_NAME,start_collection='2h')
dataset_preprocessor = CSVData(APP_NAME)
dataset_preprocessor.prepare_csv()
logging.debug("DATASET DOWNLOADED")
......
......@@ -105,9 +105,9 @@ class Prophet(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
self.connector = messaging.morphemic.Connection(ACTIVEMQ_USER,ACTIVEMQ_PASSWORD, host=ACTIVEMQ_HOSTNAME, port=ACTIVEMQ_PORT)
def run(self):
logging.debug("setting up")
sleep(180)
logging.debug("starting the connection to ActiveMQ")
#logging.debug("setting up")
#sleep(180)
#logging.debug("starting the connection to ActiveMQ")
self.connector.connect()
self.connector.set_listener(self.id, self)
self.connector.topic("start_forecasting.prophet", self.id)
......@@ -134,7 +134,7 @@ class Prophet(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
def on_metrics_to_predict(self, body):
#getting data from datasetmaker
dataset_preprocessor = CSVData(APP_NAME,start_collection='2h')
dataset_preprocessor = CSVData(APP_NAME)
dataset_preprocessor.prepare_csv()
logging.debug("DATASET DOWNLOADED")
......@@ -172,10 +172,7 @@ class Prophet(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
def start(self):
logging.debug("Staring Prophet Forecaster")
try:
self.run()
except exception.ConnectFailedException:
logging.error("Failed to connect to ActiveMQ. Please check your connection settings.")
self.run()
self._run = True
def on_disconnected(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment