diff --git a/server/memcache.go b/server/memcache.go index 5e16293..d0fa0a8 100644 --- a/server/memcache.go +++ b/server/memcache.go @@ -100,7 +100,7 @@ func (c *MemcachedClient) Set(req *CacheStoreRequest) error { Flags: req.Key.Hash(), Value: req.Value, casid: req.CasID, - Expiration: int32(req.Expiration), + Expiration: int32(req.Expiration / time.Second), } if req.CasID != 0 { if err := c.CompareAndSwap(item); err != nil { @@ -119,7 +119,7 @@ func (c *MemcachedClient) Add(key CacheKey, value []byte, expiration time.Durati &Item{ Key: key, Value: value, - Expiration: int32(expiration), + Expiration: int32(expiration / time.Second), }, (*MemcachedClient).add, ); err != nil { diff --git a/server/redis.go b/server/redis.go index e74f891..5e1878c 100644 --- a/server/redis.go +++ b/server/redis.go @@ -88,7 +88,7 @@ func (c *RedisClient) Set(req *CacheStoreRequest) error { Flags: req.Key.Hash(), Value: req.Value, casid: req.CasID, - Expiration: int32(req.Expiration), + Expiration: int32(req.Expiration / time.Second), } if err := c.onItem( @@ -106,7 +106,7 @@ func (c *RedisClient) Add(key CacheKey, value []byte, expiration time.Duration) &Item{ Key: key, Value: value, - Expiration: int32(expiration), + Expiration: int32(expiration / time.Second), }, (*RedisClient).add, ); err != nil {