Close database connection for thread after thread is finished.
This commit is contained in:
parent
049a35b94c
commit
aacb930094
3 changed files with 3 additions and 0 deletions
|
@ -57,6 +57,7 @@ class Scheduler < ApplicationModel
|
|||
job.pid = ''
|
||||
job.save
|
||||
logger.info " ...stopped thread for '#{job.method}'"
|
||||
ActiveRecord::Base.connection.close
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -377,6 +377,7 @@ module Import::OTRS2
|
|||
end
|
||||
_ticket_result(records, locks)
|
||||
end
|
||||
ActiveRecord::Base.connection.close
|
||||
}
|
||||
}
|
||||
(1..thread_count).each {|thread|
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue