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.pid = ''
|
||||||
job.save
|
job.save
|
||||||
logger.info " ...stopped thread for '#{job.method}'"
|
logger.info " ...stopped thread for '#{job.method}'"
|
||||||
|
ActiveRecord::Base.connection.close
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -377,6 +377,7 @@ module Import::OTRS2
|
||||||
end
|
end
|
||||||
_ticket_result(records, locks)
|
_ticket_result(records, locks)
|
||||||
end
|
end
|
||||||
|
ActiveRecord::Base.connection.close
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(1..thread_count).each {|thread|
|
(1..thread_count).each {|thread|
|
||||||
|
|
|
@ -498,6 +498,7 @@ returns
|
||||||
thread_client(client_id)
|
thread_client(client_id)
|
||||||
@@client_threads[client_id] = nil
|
@@client_threads[client_id] = nil
|
||||||
puts "close client (#{client_id}) thread"
|
puts "close client (#{client_id}) thread"
|
||||||
|
ActiveRecord::Base.connection.close
|
||||||
}
|
}
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue