Skip to content

Commit

Permalink
Merge pull request #1577 from ngageoint/1574-BatchBugs
Browse files Browse the repository at this point in the history
Fixes #1571. Fixes #1574
  • Loading branch information
John Tobe authored Apr 12, 2019
2 parents 1634137 + 61064ae commit 15c2e22
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scale/messaging/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _extract_command(message):

return message_class.from_json(message_body)
except KeyError as ex:
raise_from(InvalidCommandMessage('No message type handler available.'), ex)
raise_from(InvalidCommandMessage('No message type handler available for message type %s' % message['type']), ex)

def _process_message(self, message):
"""Inspects message for type and then attempts to launch execution
Expand Down
16 changes: 11 additions & 5 deletions scale/product/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,17 @@ def upload_files(self, file_entries, input_file_ids, job_exe, workspace):
product.recipe_node = job_recipe.node_name

# Add batch info to product if available.
try:
from batch.models import BatchJob
product.batch_id = BatchJob.objects.get(job_id=job_exe.job_id).batch_id
except BatchJob.DoesNotExist:
product.batch_id = None

if job_exe.batch:
product.batch_id = job_exe.batch.id
elif job_exe.job.batch:
product.batch_id = job_exe.job.batch.id
else:
try:
from batch.models import BatchJob
product.batch_id = BatchJob.objects.get(job_id=job_exe.job_id).batch_id
except BatchJob.DoesNotExist:
product.batch_id = None

# Allow override, if set via side-car metadata, otherwise take derived values from above
product.source_started = entry.source_started if entry.source_started else source_started
Expand Down
2 changes: 2 additions & 0 deletions scale/recipe/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def ready(self):
from recipe.messages.reprocess_recipes import ReprocessRecipes
from recipe.messages.supersede_recipe_nodes import SupersedeRecipeNodes
from recipe.messages.update_recipe import UpdateRecipe
from recipe.messages.update_recipe_definition import UpdateRecipeDefinition
from recipe.messages.update_recipe_metrics import UpdateRecipeMetrics
from recipe.messages.update_recipes import UpdateRecipes

Expand All @@ -35,5 +36,6 @@ def ready(self):
add_message_type(ReprocessRecipes)
add_message_type(SupersedeRecipeNodes)
add_message_type(UpdateRecipe)
add_message_type(UpdateRecipeDefinition)
add_message_type(UpdateRecipeMetrics)
add_message_type(UpdateRecipes)
2 changes: 2 additions & 0 deletions scale/storage/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def ready(self):

# Register storage message types
from storage.messages.delete_files import DeleteFiles
from storage.messages.move_files import MoveFile
from messaging.messages.factory import add_message_type

add_message_type(DeleteFiles)
add_message_type(MoveFile)

0 comments on commit 15c2e22

Please # to comment.