Remove SQL state locking and rely on sqlite locking

Also renames some parameters from locksDir -> lockDir for
consistency.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
Matthew Heon
2017-11-27 13:42:45 -05:00
parent abfd18b0db
commit e9298a533a
5 changed files with 19 additions and 45 deletions

View File

@ -268,7 +268,7 @@ type scannable interface {
}
// Read a single container from a single row result in the database
func ctrFromScannable(row scannable, runtime *Runtime, specsDir string, locksDir string) (*Container, error) {
func ctrFromScannable(row scannable, runtime *Runtime, specsDir string, lockDir string) (*Container, error) {
var (
id string
name string
@ -387,7 +387,7 @@ func ctrFromScannable(row scannable, runtime *Runtime, specsDir string, locksDir
ctr.runtime = runtime
// Ensure the lockfile exists
lockPath := filepath.Join(locksDir, id)
lockPath := filepath.Join(lockDir, id)
_, err = os.Stat(lockPath)
if err != nil {
return nil, errors.Wrapf(err, "error performing stat on container %s lockfile", id)