Skip to content

Commit

Permalink
Fix: remove the error (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
little-cui authored Jan 19, 2022
1 parent dc7bd54 commit 8ae374a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dlock/mongo/dlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package mongo

import (
"errors"
"sync"

"github.com/go-chassis/cari/dlock"
Expand All @@ -28,8 +27,6 @@ func init() {
dlock.Install("mongo", NewDLock)
}

var ErrNotImplement = errors.New("func do not implemented")

func NewDLock() (dlock.DLock, error) {
return &DB{lockMap: sync.Map{}}, nil
}
Expand All @@ -40,17 +37,17 @@ type DB struct {

func (d *DB) Lock(key string, ttl int64) error {
// TODO need to implement it
return ErrNotImplement
return nil
}

func (d *DB) TryLock(key string, ttl int64) error {
// TODO need to implement it
return ErrNotImplement
return nil
}

func (d *DB) Renew(key string) error {
// TODO need to implement it
return ErrNotImplement
return nil
}

func (d *DB) IsHoldLock(key string) bool {
Expand All @@ -62,5 +59,5 @@ func (d *DB) IsHoldLock(key string) bool {

func (d *DB) Unlock(key string) error {
// TODO need to implement it
return ErrNotImplement
return nil
}

0 comments on commit 8ae374a

Please sign in to comment.