Skip to content

Database:onDisconnect() callback feature request #135

@blobles-dev

Description

@blobles-dev

My current setup is each player has their own connection, this ensures that any actions they do with my inventory system are completed in order - however, my global table of connections can become stale and essentially a memory leak.

'example'
player join:
         create sql connection in globals SQL_CONS[ply:SteamID64()]
player disconnect:
          SQL_CONS[ply:SteamID64()]:disconnect(true) -- wait for the queue to clear

With the above scenario, SQL_CONS will still maintain an index with an disconnected connection that is not needed.

I have no way of detecting the successful disconnection to clear out the value in the global table - I'm going to write a timer that will check the connections every 10 minutes or so and drop stale references, but it would be nice to clear it out as soon as the queue is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions