From b58d7578487bb5991971e41b1176e016e03f9c7c Mon Sep 17 00:00:00 2001 From: bohung Date: Mon, 23 May 2022 18:38:11 +0800 Subject: [PATCH] Fix bug. --- config/routes.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index aec9adf..19d3e92 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,12 @@ Rails.application.routes.draw do - Thread.new do - c = Cancerpredictfields.last - if c - sleep(5) - c.save - c.auto_write_predict_js + if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console') + Thread.new do + c = Cancerpredictfields.last + if c + sleep(5) + c.save + c.auto_write_predict_js + end end end locales = Site.first.in_use_locales rescue I18n.available_locales