Merge develop

This commit is contained in:
Ming Deng
2021-02-02 10:25:05 +08:00
10 changed files with 201 additions and 51 deletions

View File

@@ -86,8 +86,8 @@ func TestMemcacheCache(t *testing.T) {
vv := bm.GetMulti([]string{"astaxie", "astaxie1"})
assert.Equal(t, 2, len(vv))
assert.Equal(t, "author", vv[0])
assert.Equal(t, "author1", vv[1])
assert.Equal(t, []byte("author"), vv[0])
assert.Equal(t, []byte("author1"), vv[1])
assert.Nil(t, bm.ClearAll())
}

View File

@@ -83,7 +83,7 @@ func TestRedisCache(t *testing.T) {
assert.Nil(t, bm.Put("astaxie1", "author1", timeoutDuration))
assert.False(t, bm.IsExist("astaxie1"))
assert.True(t, bm.IsExist("astaxie1"))
vv := bm.GetMulti([]string{"astaxie", "astaxie1"})

View File

@@ -37,7 +37,7 @@ func TestSsdbcacheCache(t *testing.T) {
assert.Nil(t, ssdb.Put("ssdb", "ssdb", timeoutDuration))
assert.True(t, ssdb.IsExist("ssdb"))
assert.NotNil(t, ssdb.Put("ssdb", "ssdb", timeoutDuration))
assert.Nil(t, ssdb.Put("ssdb", "ssdb", timeoutDuration))
assert.Equal(t, "ssdb", ssdb.Get("ssdb"))

View File

@@ -115,12 +115,6 @@ func (b *BeegoHTTPRequest) SetUserAgent(useragent string) *BeegoHTTPRequest {
return b
}
// Debug sets show debug or not when executing request.
func (b *BeegoHTTPRequest) Debug(isdebug bool) *BeegoHTTPRequest {
b.delegate.Debug(isdebug)
return b
}
// Retries sets Retries times.
// default is 0 means no retried.
// -1 means retried forever.
@@ -135,17 +129,6 @@ func (b *BeegoHTTPRequest) RetryDelay(delay time.Duration) *BeegoHTTPRequest {
return b
}
// DumpBody setting whether need to Dump the Body.
func (b *BeegoHTTPRequest) DumpBody(isdump bool) *BeegoHTTPRequest {
b.delegate.DumpBody(isdump)
return b
}
// DumpRequest return the DumpRequest
func (b *BeegoHTTPRequest) DumpRequest() []byte {
return b.delegate.DumpRequest()
}
// SetTimeout sets connect time out and read-write time out for BeegoRequest.
func (b *BeegoHTTPRequest) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *BeegoHTTPRequest {
b.delegate.SetTimeout(connectTimeout, readWriteTimeout)

View File

@@ -22,7 +22,10 @@ func TestRedisSentinel(t *testing.T) {
}
globalSessions, e := session.NewManager("redis_sentinel", sessionConfig)
assert.Nil(t, e)
if e != nil {
t.Log(e)
return
}
go globalSessions.GC()