diff --git a/Gemfile b/Gemfile index b3b0bfcb6..f470c166b 100644 --- a/Gemfile +++ b/Gemfile @@ -156,10 +156,10 @@ group :test do end # just to make sure they're the same -group :production, :qa do +# group :production, :qa do gem 'google-analytics-rails', '1.1.0' gem 'lograge' -end +# end # Install the bundle --with aws when running on Amazon Elastic Beanstalk group :aws, optional: true do @@ -175,14 +175,15 @@ group :zoom, optional: true do end # Install the bundle --with postgres if using postgresql as the database backend -group :postgres, optional: true do +# group :postgres, optional: true do gem 'pg' -end +# end # Install the bundle --with mysql if using mysql as the database backend group :mysql, optional: true do gem 'mysql2' end -extra_gems = File.expand_path("../Gemfile.local", __FILE__) -eval File.read(extra_gems) if File.exist?(extra_gems) +# no thanks +# extra_gems = File.expand_path("../Gemfile.local", __FILE__) +# eval File.read(extra_gems) if File.exist?(extra_gems) diff --git a/app/controllers/mars_ingest_failures_controller.rb b/app/controllers/mars_ingest_failures_controller.rb new file mode 100644 index 000000000..203a1be77 --- /dev/null +++ b/app/controllers/mars_ingest_failures_controller.rb @@ -0,0 +1,12 @@ +class MarsIngestFailuresController < ApplicationController + before_action :authenticate_user! + + def index + @mars_ingest_failures = MarsIngestFailure.order(created_at: :desc).all + end + + def show + @mars_ingest_failure = MarsIngestFailure.find(params[:id]) + render 'show', layout: false, content_type: 'text/plain' + end +end diff --git a/app/controllers/mars_ingests_controller.rb b/app/controllers/mars_ingests_controller.rb index c5ceb5105..09313541b 100644 --- a/app/controllers/mars_ingests_controller.rb +++ b/app/controllers/mars_ingests_controller.rb @@ -34,6 +34,8 @@ def create render json: { id: @mars_ingest.id }, status: 200 else Rails.logger.info "MarsIngest could not be saved: (#{ @mars_ingest.errors.messages.values.flatten })" + # save error text! this is only for ingests manually created through the UI + MarsIngestFailure.create(manifest_url: @mars_ingest.manifest_url, error_text: @mars_ingest.errors.messages.values.flatten) render json: { errors: @mars_ingest.errors.messages.values.flatten }, status: 422 end rescue => e diff --git a/app/models/mars_ingest_failure.rb b/app/models/mars_ingest_failure.rb new file mode 100644 index 000000000..a0ec81729 --- /dev/null +++ b/app/models/mars_ingest_failure.rb @@ -0,0 +1,2 @@ +class MarsIngestFailure < ActiveRecord::Base +end diff --git a/app/services/mars_ingest_watcher.rb b/app/services/mars_ingest_watcher.rb index 451ee98cd..fd2196b2b 100644 --- a/app/services/mars_ingest_watcher.rb +++ b/app/services/mars_ingest_watcher.rb @@ -79,6 +79,7 @@ def self.run_manifest(key) end else puts "Darn! Manifest invalid! #{mi.errors.messages.values.flatten}" + MarsIngestFailure.create(manifest_url: mi.manifest_url, error_text: mi.errors.messages.values.flatten) end end diff --git a/app/views/mars_ingest_failures/index.html.erb b/app/views/mars_ingest_failures/index.html.erb new file mode 100644 index 000000000..60d7608e1 --- /dev/null +++ b/app/views/mars_ingest_failures/index.html.erb @@ -0,0 +1,15 @@ +<% @page_title = t('mars_ingests.title', :application_name => application_name) %> + +