From 7248be908fca037e1e3f824ce064f5f968c6fd5e Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Thu, 7 Sep 2017 15:50:46 +0200 Subject: [PATCH] Improved migration and changed wording. --- app/assets/javascripts/app/views/monitoring.jst.eco | 6 +++--- app/controllers/monitoring_controller.rb | 2 +- db/migrate/20120101000001_create_base.rb | 2 ++ db/migrate/20170515000001_scheduler_status.rb | 8 ++++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/views/monitoring.jst.eco b/app/assets/javascripts/app/views/monitoring.jst.eco index 5619b15b6..d5650ee79 100644 --- a/app/assets/javascripts/app/views/monitoring.jst.eco +++ b/app/assets/javascripts/app/views/monitoring.jst.eco @@ -35,11 +35,11 @@ <% end %> <% if !_.isEmpty(@data.issues): %> - + <% if !_.isUndefined(@job_restart_count): %>

- <%- @T('Detected %s failed job(s) available for restart', @job_restart_count) %> - <%- ', restarting...' if @job_restart_count > 0 %> + <%- @T('%s failed job(s) marked for restart', @job_restart_count) %> + <%- @T(', restarting...') if @job_restart_count > 0 %>

<% end %> <% end %> diff --git a/app/controllers/monitoring_controller.rb b/app/controllers/monitoring_controller.rb index fa9867fd1..4da0addde 100644 --- a/app/controllers/monitoring_controller.rb +++ b/app/controllers/monitoring_controller.rb @@ -82,7 +82,7 @@ curl http://localhost/api/v1/monitoring/health_check?token=XXX end Scheduler.where(status: 'error').each do |scheduler| - issues.push "Failed to run scheduled job \'#{scheduler.name}\'. Cause: #{scheduler.error_message}" + issues.push "Failed to run scheduled job '#{scheduler.name}'. Cause: #{scheduler.error_message}" end token = Setting.get('monitoring_token') diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 71547ebb9..78708a076 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -514,6 +514,8 @@ class CreateBase < ActiveRecord::Migration t.integer :prio, null: false t.string :pid, limit: 250, null: true t.string :note, limit: 250, null: true + t.string :error_message, null: true + t.string :status, null: true t.boolean :active, null: false, default: false t.integer :updated_by_id, null: false t.integer :created_by_id, null: false diff --git a/db/migrate/20170515000001_scheduler_status.rb b/db/migrate/20170515000001_scheduler_status.rb index ae9f0c46e..dcaa8ef87 100644 --- a/db/migrate/20170515000001_scheduler_status.rb +++ b/db/migrate/20170515000001_scheduler_status.rb @@ -1,8 +1,12 @@ class SchedulerStatus < ActiveRecord::Migration[4.2] def up + + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + change_table :schedulers do |t| - t.string :error_message - t.string :status + t.string :error_message, null: true + t.string :status, null: true end end end