-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
This used to work in 1.6 but no longer in 1.7 or 1.8, with error
.../pgmoon/init.lua:194: attempt to index field 'sock' (a nil value)
File app/db.lua
local pg = require('pgmoon')
return pg.new({...})
File app/handler.lua
local db = require('app.db')
function ware1(db)
db:connect()
-- do work
db:keepalive()
end
function ware2(db)
db:connect()
-- do work
db:keepalive()
end
function handler(db)
ware1(db)
-- do some work
ware2(db)
-- do more work
end
I found that the self.sock handle is set to nil after keepalive().
Can we call connect() after keepalive() if they are within the same request?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels