mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
bug fix
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
func CheckNotExist(src string) bool {
|
func CheckNotExist(src string) bool {
|
||||||
_, err := os.Stat(src)
|
_, err := os.Stat(src)
|
||||||
|
|
||||||
return os.IsNotExist(err)
|
return os.IsNotExist(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ import "testing"
|
|||||||
func TestMGenerator(t *testing.T) {
|
func TestMGenerator(t *testing.T) {
|
||||||
gen := MakeGenerator("a")
|
gen := MakeGenerator("a")
|
||||||
ids := make(map[int64]struct{})
|
ids := make(map[int64]struct{})
|
||||||
size := int(maxSequence) - 1
|
size := int(1e6)
|
||||||
for i := 0; i < size; i++ {
|
for i := 0; i < size; i++ {
|
||||||
id := gen.NextId()
|
id := gen.NextId()
|
||||||
_, ok := ids[id]
|
_, ok := ids[id]
|
||||||
|
@@ -134,6 +134,7 @@ func (client *Client) doHeartbeat() {
|
|||||||
request := &Request{
|
request := &Request{
|
||||||
args: [][]byte{[]byte("PING")},
|
args: [][]byte{[]byte("PING")},
|
||||||
heartbeat: true,
|
heartbeat: true,
|
||||||
|
waiting: &wait.Wait{},
|
||||||
}
|
}
|
||||||
request.waiting.Add(1)
|
request.waiting.Add(1)
|
||||||
client.working.Add(1)
|
client.working.Add(1)
|
||||||
|
@@ -60,6 +60,7 @@ func TestClient(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.doHeartbeat() // random do heartbeat
|
||||||
result = client.Send([][]byte{
|
result = client.Send([][]byte{
|
||||||
[]byte("GET"),
|
[]byte("GET"),
|
||||||
[]byte("a"),
|
[]byte("a"),
|
||||||
|
Reference in New Issue
Block a user