Add Close to Conn interface

This commit is contained in:
Jimmy Zelinskie 2014-07-18 19:37:13 -04:00
parent 5bd3b3efb3
commit b962f49c90
2 changed files with 6 additions and 0 deletions

View file

@ -68,6 +68,8 @@ type Pool interface {
// Conn represents a connection to the data store that can be used // Conn represents a connection to the data store that can be used
// to make reads/writes. // to make reads/writes.
type Conn interface { type Conn interface {
Close() error
// Torrent interactions // Torrent interactions
FindTorrent(infohash string) (*models.Torrent, error) FindTorrent(infohash string) (*models.Torrent, error)
PutTorrent(t *models.Torrent) error PutTorrent(t *models.Torrent) error

View file

@ -17,6 +17,10 @@ type Conn struct {
*Pool *Pool
} }
func (c *Conn) Close() error {
return nil
}
func (c *Conn) FindUser(passkey string) (*models.User, error) { func (c *Conn) FindUser(passkey string) (*models.User, error) {
c.usersM.RLock() c.usersM.RLock()
defer c.usersM.RUnlock() defer c.usersM.RUnlock()