Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/usr/bin/env tarantool
  2.  
  3. box.cfg {}
  4.  
  5. local log = require('log')
  6. local os = require('os')
  7. local mysql = require('mysql')
  8. local fiber = require('fiber')
  9.  
  10. local pool = mysql.pool_create({ host = '127.0.0.1', user = 'root', password = '11', db = 'tempdb', size = 5, raise = true })
  11.  
  12. function leak_connection()
  13. local conn = pool:get()
  14. log.info(fiber.self():id() .. ' : ' .. os.time() .. ' : invoke conn:ping() : ' .. tostring(conn:ping()))
  15. end
  16.  
  17. for i = 1,10 do
  18. local new_fiber = fiber.create(leak_connection)
  19. log.info(fiber.self():id() .. ' : ' .. os.time() .. ' : create fiber ' .. new_fiber:id())
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement