Close database connection for thread after thread is finished.

This commit is contained in:
Martin Edenhofer 2015-02-16 13:41:46 +01:00
parent 049a35b94c
commit aacb930094
3 changed files with 3 additions and 0 deletions

View file

@ -57,6 +57,7 @@ class Scheduler < ApplicationModel
job.pid = ''
job.save
logger.info " ...stopped thread for '#{job.method}'"
ActiveRecord::Base.connection.close
}
end

View file

@ -377,6 +377,7 @@ module Import::OTRS2
end
_ticket_result(records, locks)
end
ActiveRecord::Base.connection.close
}
}
(1..thread_count).each {|thread|

View file

@ -498,6 +498,7 @@ returns
thread_client(client_id)
@@client_threads[client_id] = nil
puts "close client (#{client_id}) thread"
ActiveRecord::Base.connection.close
}
sleep 0.5
end