Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env tarantool
- box.cfg {}
- local log = require('log')
- local os = require('os')
- local mysql = require('mysql')
- local fiber = require('fiber')
- local pool = mysql.pool_create({ host = '127.0.0.1', user = 'root', password = '11', db = 'tempdb', size = 5, raise = true })
- function leak_connection()
- local conn = pool:get()
- log.info(fiber.self():id() .. ' : ' .. os.time() .. ' : invoke conn:ping() : ' .. tostring(conn:ping()))
- end
- for i = 1,10 do
- local new_fiber = fiber.create(leak_connection)
- log.info(fiber.self():id() .. ' : ' .. os.time() .. ' : create fiber ' .. new_fiber:id())
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement