Skip to content

Commit 42335d7

Browse files
committed
add forget
1 parent 7b7ab56 commit 42335d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flight.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type Job func() []byte
1414

1515
type Group interface {
1616
Do(jobKey string, job Job) (result []byte, shared bool, err error)
17+
Forget(jobKey string) (err error)
1718
}
1819

1920
func New(opt Option) Group {
@@ -141,3 +142,7 @@ func (f *groupImpl) tryFetchResult(dataKey string) ([]byte, bool, error) {
141142
}
142143
return sharedResult, true, nil
143144
}
145+
146+
func (f *groupImpl) Forget(jobKey string) error {
147+
return f.client.Del(f.makeLockKey(jobKey))
148+
}

0 commit comments

Comments
 (0)