Browse Source

worker->analytic_worker

pull/1/head
Alexey Velikiy 7 years ago
parent
commit
9da8bbcf11
  1. 4
      analytics/analytic_unit_worker.py
  2. 4
      analytics/server.py

4
analytics/worker.py → analytics/analytic_unit_worker.py

@ -13,7 +13,7 @@ import time
logger = logging.getLogger('WORKER')
class Worker(object):
class AnalyticUnitWorker(object):
models_cache = {}
thread = None
queue = queue.Queue()
@ -85,7 +85,7 @@ class Worker(object):
}
else:
result = self.do_predict(analytic_unit_id, last_prediction_time, pattern)
result['task'] = 'learn'
return result

4
analytics/server.py

@ -4,7 +4,7 @@ import logging
import zmq
import sys
from worker import Worker
from worker import AnalyticUnitWorker
root = logging.getLogger()
@ -46,7 +46,7 @@ def handle_task(text):
if __name__ == "__main__":
worker = Worker()
worker = AnalyticUnitWorker()
logger.info("Worker was started")
logger.info("Binding to %s ..." % config.ZEROMQ_CONNECTION_STRING)

Loading…
Cancel
Save