Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:fishioon/redis-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
ifishjin committed May 31, 2018
2 parents c6e95f8 + e9c0990 commit 64ece5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lock_test.go
@@ -1,7 +1,9 @@
package lock

import (
"fmt"
"math/rand"
"os"
"sync"
"sync/atomic"
"testing"
Expand All @@ -18,12 +20,15 @@ var _ = Describe("Locker", func() {
var (
subject *Locker
)
hostname, _ := os.Hostname()
tokenPfx := fmt.Sprintf("%s-%d-", hostname, os.Getpid())

var newLock = func() *Locker {
return New(redisClient, testRedisKey, &Options{
RetryCount: 4,
RetryDelay: 25 * time.Millisecond,
LockTimeout: time.Second,
TokenPrefix: tokenPfx,
})
}

Expand Down

0 comments on commit 64ece5a

Please sign in to comment.