Skip to content

Commit

Permalink
add stubs for rerun_job as per #77
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Jul 2, 2019
1 parent 4d057c4 commit ff7a841
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions app/controllers/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def create_job
recipe = JSON.parse(params["job"])["recipe"]
annotators = JSON.parse(params["job"])["annotators"]
recipe_id = prepare_recipe(recipe)

# Create the annotators
annotators.each do |annotator|
prepare_annotator(annotator, recipe_id)
end

# Run the recipe
run_recipe(recipe_id)
render :json => { status: "success", message: "Catalyst job created" }
Expand All @@ -54,7 +54,7 @@ def get_filtered_count(recipe, docs_to_process)
elsif docs_to_process[:run_over] == "all"
return get_total_doc_count_for_type(recipe[:index_name], recipe[:doc_type])
end

end

# Create and save the recipe and return the ID
Expand All @@ -81,6 +81,10 @@ def parse_recipe(job)
}
end

def rerun_job(job_id)
puts "Will eventually re-run job"
end

# Prepare and save annotator
def prepare_annotator(a, recipe_id)
# Parse each one into correct format, preparsing some fields
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
post 'api/recipe_search', to: 'api#recipe_search'
post 'api/create_job', to: 'api#create_job'
get 'api/facets', to: 'api#facets'
get 'api/delete_recipe', to: 'api#delete_recipe'
get 'api/rerun_job', to: 'api#rerun_job'

root to: 'docs#index'
resources :docs
Expand Down

0 comments on commit ff7a841

Please sign in to comment.