mozilla-services / pushgo

🚨🚨🚨OBSOLETE AND UNMAINTAINED🚨🚨🚨 See Autopush for the current server.
https://github.com/mozilla-services/autopush
Mozilla Public License 2.0
24 stars 10 forks source link

Add `Serv.UpdateClient()` to avoid re-locking the client map #155

Closed ghost closed 9 years ago

ghost commented 9 years ago

Currently, RouteHandler calls app.ClientExists(), locking the client map. If the client is connected, the handler calls server.Update(), which re-locks the map to retrieve the client. We can add Server.UpdateClient(c *Client, chid, uid string, vers int64, time time.Time, data string) to avoid reacquiring the lock.

Noted by @bbangert on IRC; related to #154.