Skip to content

Commit

Permalink
Fix request json serialization
Browse files Browse the repository at this point in the history
It's not an issue right now, but when we start sending json over the
celry wire, it'll fatal as request object is a dictionary and doesn't
have format method
  • Loading branch information
Ladsgroup committed Nov 5, 2018
1 parent 636df5b commit 8d827a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ores/scoring_systems/celery_queue.py
Expand Up @@ -56,12 +56,12 @@ def _initialize_tasks(self):
@self.application.task(throws=expected_errors,
queue=DEFAULT_CELERY_QUEUE)
def _process_score_map(request, model_names, rev_id, root_cache):
logger.info("Generating a score map for {0}"
.format(request.format(rev_id, model_names)))

if not isinstance(request, ScoreRequest):
request = ScoreRequest.from_json(request)

logger.info("Generating a score map for {0}"
.format(request.format(rev_id, model_names)))

score_map = ScoringSystem._process_score_map(
self, request, rev_id, model_names,
root_cache=root_cache)
Expand Down Expand Up @@ -94,7 +94,7 @@ def _process_missing_scores(self, request, missing_model_set_revs,
continue
root_cache = {str(k): v for k, v in root_caches[rev_id].items()}
result = self._process_score_map.delay(
request.to_json(), missing_models, rev_id, root_cache)
request, missing_models, rev_id, root_cache)
self._lock_process(missing_models, rev_id, request,
injection_cache, result.id)

Expand Down

0 comments on commit 8d827a4

Please sign in to comment.