mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:20:55 +00:00
duration change to second
This commit is contained in:
parent
850dc59b6e
commit
fa4a231cd4
4
cache/cache_test.go
vendored
4
cache/cache_test.go
vendored
@ -25,7 +25,7 @@ func TestCache(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("init err")
|
t.Error("init err")
|
||||||
}
|
}
|
||||||
timeoutDuration := 10 * time.Second
|
timeoutDuration := 10
|
||||||
if err = bm.Put("astaxie", 1, timeoutDuration*time.Second); err != nil {
|
if err = bm.Put("astaxie", 1, timeoutDuration*time.Second); err != nil {
|
||||||
t.Error("set Error", err)
|
t.Error("set Error", err)
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ func TestFileCache(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("init err")
|
t.Error("init err")
|
||||||
}
|
}
|
||||||
timeoutDuration := 10 * time.Second
|
timeoutDuration := 10
|
||||||
if err = bm.Put("astaxie", 1, timeoutDuration*time.Second); err != nil {
|
if err = bm.Put("astaxie", 1, timeoutDuration*time.Second); err != nil {
|
||||||
t.Error("set Error", err)
|
t.Error("set Error", err)
|
||||||
}
|
}
|
||||||
|
2
cache/memcache/memcache_test.go
vendored
2
cache/memcache/memcache_test.go
vendored
@ -29,7 +29,7 @@ func TestMemcacheCache(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("init err")
|
t.Error("init err")
|
||||||
}
|
}
|
||||||
timeoutDuration := 10 * time.Second
|
timeoutDuration := 10
|
||||||
if err = bm.Put("astaxie", "1", timeoutDuration*time.Second); err != nil {
|
if err = bm.Put("astaxie", "1", timeoutDuration*time.Second); err != nil {
|
||||||
t.Error("set Error", err)
|
t.Error("set Error", err)
|
||||||
}
|
}
|
||||||
|
4
cache/redis/redis_test.go
vendored
4
cache/redis/redis_test.go
vendored
@ -18,8 +18,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/garyburd/redigo/redis"
|
|
||||||
"github.com/astaxie/beego/cache"
|
"github.com/astaxie/beego/cache"
|
||||||
|
"github.com/garyburd/redigo/redis"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRedisCache(t *testing.T) {
|
func TestRedisCache(t *testing.T) {
|
||||||
@ -27,7 +27,7 @@ func TestRedisCache(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("init err")
|
t.Error("init err")
|
||||||
}
|
}
|
||||||
timeoutDuration := 10 * time.Second
|
timeoutDuration := 10
|
||||||
if err = bm.Put("astaxie", 1, timeoutDuration*time.Second); err != nil {
|
if err = bm.Put("astaxie", 1, timeoutDuration*time.Second); err != nil {
|
||||||
t.Error("set Error", err)
|
t.Error("set Error", err)
|
||||||
}
|
}
|
||||||
|
2
cache/ssdb/ssdb_test.go
vendored
2
cache/ssdb/ssdb_test.go
vendored
@ -18,7 +18,7 @@ func TestSsdbcacheCache(t *testing.T) {
|
|||||||
if ssdb.IsExist("ssdb") {
|
if ssdb.IsExist("ssdb") {
|
||||||
t.Error("check err")
|
t.Error("check err")
|
||||||
}
|
}
|
||||||
timeoutDuration := 10 * time.Second
|
timeoutDuration := 10
|
||||||
//timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
|
//timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
|
||||||
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration*time.Second); err != nil {
|
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration*time.Second); err != nil {
|
||||||
t.Error("set Error", err)
|
t.Error("set Error", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user