From 4bfc0af0b30b1716c12edab497fa4fbb36f32ab5 Mon Sep 17 00:00:00 2001 From: Daniel Kastl Date: Mon, 26 Jun 2023 16:51:05 +0900 Subject: [PATCH] uses after_initialize Signed-off-by: Daniel Kastl --- init.rb | 5 +++++ lib/redmine_gtt_assistant.rb | 2 -- lib/redmine_gtt_assistant/openai.rb | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/init.rb b/init.rb index 6e90f33..07b8588 100644 --- a/init.rb +++ b/init.rb @@ -35,3 +35,8 @@ end end + +# Initialize GTT Assistant +Rails.application.config.after_initialize do + RedmineGttAssistant.setup +end diff --git a/lib/redmine_gtt_assistant.rb b/lib/redmine_gtt_assistant.rb index 3490784..c9319e7 100644 --- a/lib/redmine_gtt_assistant.rb +++ b/lib/redmine_gtt_assistant.rb @@ -40,5 +40,3 @@ def self.request_timeout end end -# Initialize GTT Assistant -RedmineGttAssistant.setup diff --git a/lib/redmine_gtt_assistant/openai.rb b/lib/redmine_gtt_assistant/openai.rb index ea2ab30..ad15126 100644 --- a/lib/redmine_gtt_assistant/openai.rb +++ b/lib/redmine_gtt_assistant/openai.rb @@ -11,8 +11,8 @@ def self.init OpenAI.configure do |config| config.access_token = ENV['OPENAI_API_KEY'] config.organization_id = ENV['OPENAI_API_ORG'] - # config.request_timeout = RedmineGttAssistant.request_timeout - config.request_timeout = 120 + config.request_timeout = RedmineGttAssistant.request_timeout + # config.request_timeout = 120 end end