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.

This commit is contained in:
Thorsten Eckel 2017-03-28 16:23:23 +02:00
parent f7ba0a2865
commit 94debbfe4b

View file

@ -83,6 +83,11 @@ module Import
threads[thread] = Thread.new { 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[:thread_no] = thread
Thread.current[:loop_count] = 0 Thread.current[:loop_count] = 0
@ -163,5 +168,9 @@ module Import
def customer_user def customer_user
limit_import('CustomerUser', limit: 50) limit_import('CustomerUser', limit: 50)
end end
def reset_database_information
::Ticket.reset_column_information
end
end end
end end