Fixes to compile errors for new interface.

This commit is contained in:
Adam Kaplan 2015-10-21 14:35:06 -04:00
parent 4f8dba9d9d
commit 850b4536a9
2 changed files with 11 additions and 3 deletions

View File

@ -98,7 +98,7 @@ func (store *FileStore) Terminate(id string) error {
return nil return nil
} }
func (store *FileStore) LockFile(id string) (hasLock bool, err) { func (store *FileStore) LockFile(id string) (hasLock bool, err error) {
info, err := store.GetInfo(id) info, err := store.GetInfo(id)
if err != nil { if err != nil {
hasLock = false hasLock = false
@ -110,7 +110,7 @@ func (store *FileStore) LockFile(id string) (hasLock bool, err) {
return return
} }
info.Locked = true info.Locked = true
err = writeInfo(id, info) err = store.writeInfo(id, info)
if err != nil { if err != nil {
hasLock = false hasLock = false
return return
@ -125,7 +125,7 @@ func (store *FileStore) UnlockFile(id string) (err error) {
return return
} }
info.Locked = false info.Locked = false
err = writeInfo(info) err = store.writeInfo(id, info)
return return
} }

View File

@ -49,6 +49,14 @@ func (store *dataStore) Terminate(id string) error {
return nil return nil
} }
func (store *dataStore) LockFile(id string) (bool, error) {
return true, nil
}
func (store *dataStore) UnlockFile(id string) (error) {
return nil
}
func TestLimitedStore(t *testing.T) { func TestLimitedStore(t *testing.T) {
dataStore := &dataStore{ dataStore := &dataStore{
t: t, t: t,