diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5728cbb30..c9c725013 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -39,11 +39,11 @@ def application_time_zone(&block) def check_up if ScheduleSnapshot.where("status = 'in_progress'").count > 0 - redirect_to '/maintenance.html', status: 503 + redirect_to '/maintenance.html', status: 307 end # Stop people from making changes if we are running any long job if JobStatus.where("status = 'inprogress'").count > 0 - redirect_to '/maintenance.html', status: 503 + redirect_to '/maintenance.html', status: 307 end end diff --git a/app/javascript/http.js b/app/javascript/http.js index e3a65b4b3..b3145dbf7 100644 --- a/app/javascript/http.js +++ b/app/javascript/http.js @@ -6,13 +6,13 @@ export const http = axios.create({}) http.interceptors.response.use( response => { - if (response.status == 503) { + if (response.status == 503 || response.status == 307) { window.location = "/maintenance.html" } return response; }, error => { - if (error.response && error.response.status == 503) { + if (error.response && (error.response.status == 503 || response.status == 307)) { window.location = "/maintenance.html" }