Skip to content

Commit

Permalink
ws - specif graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Signorini committed Oct 31, 2018
1 parent 2ef027a commit aba607d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions app/repository/maestroRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def exec_request(self, path, json=None, data=None):
return self

def get_status(self):
return self.__context.status_code
try:
return self.__context.status_code
except Exception as error:
raise ClientMaestroError("Endpoint not up %s" % self.__path)

def get_json(self):
logger.info("Request[CODE %s] - %s", self.get_status(), self.__path)

if self.__context.status_code is 200:
if self.get_status() is 200:
return self.__context.json()

logger.info("Error %s", self.__context.text)

if self.__context.status_code in [500, 503, 504]:
if self.get_status() in [500, 503, 504, 0]:
raise ClientMaestroError(self.__context.text)
2 changes: 1 addition & 1 deletion app/tasks/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def task_ws(graph_id, owner_id, status='success'):
"type": status
},
"event": {
"caller": "analytics-update"
"caller": ["analytics-update", "analytics-{}".format(graph_id)]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion instance/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ class Config(object):
CELERY_DEFAULT_QUEUE = 'analytics'

CELERYD_TASK_TIME_LIMIT = os.environ.get("CELERYD_TASK_TIME_LIMIT", 60)
CELERYD_TASK_SOFT_TIME_LIMIT = os.environ.get("CELERYD_TASK_SOFT_TIME_LIMIT", 1080)
CELERYD_TASK_SOFT_TIME_LIMIT = os.environ.get("CELERYD_TASK_SOFT_TIME_LIMIT", 60)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "run.py",
"scripts": {
"server": "FLASK_APP=run.py FLASK_DEBUG=1 flask run --port=5020",
"celery": "celery -A app.celery worker -l=info",
"save": "pip freeze -l > requirements.txt ",
"celery": "celery -A app.celery worker -Ofair --hostname=analytics@%h -l=info",
"save": "pip freeze -l > requirements.txt",
"test": "python -m unittest discover",
"package-flask": "docker build -t analytics-maestro .",
"package-celery": "docker build -f DockerfileCelery -t analytics-maestro-celery .",
Expand Down

0 comments on commit aba607d

Please sign in to comment.