From 94debbfe4b8a3681aaf64f2b296ccb14f6672d31 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 28 Mar 2017 16:23:23 +0200 Subject: [PATCH] In some environments the Model.reset_column_information is not reflected to threads. So an import error message appears. Reset needed model column information for each thread. --- lib/import/otrs.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index 1fdc96503..9741a5de6 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -83,6 +83,11 @@ module Import threads[thread] = Thread.new { + # In some environments the Model.reset_column_information + # is not reflected to threads. So an import error message appears. + # Reset needed model column information for each thread. + reset_database_information + Thread.current[:thread_no] = thread Thread.current[:loop_count] = 0 @@ -163,5 +168,9 @@ module Import def customer_user limit_import('CustomerUser', limit: 50) end + + def reset_database_information + ::Ticket.reset_column_information + end end end