Make expiration a Duration

This commit is contained in:
Jonathan Lange
2016-07-04 13:30:23 +01:00
parent f7bdedc149
commit c1dab17fb3
2 changed files with 4 additions and 4 deletions

View File

@@ -56,10 +56,10 @@ type MemcacheClient struct {
// MemcacheConfig defines how a MemcacheClient should be constructed.
type MemcacheConfig struct {
Host string
Timeout time.Duration
Service string
Timeout time.Duration
UpdateInterval time.Duration
Expiration int32
Expiration time.Duration
}
// NewMemcacheClient creates a new MemcacheClient that gets its server list
@@ -72,7 +72,7 @@ func NewMemcacheClient(config MemcacheConfig) *MemcacheClient {
newClient := &MemcacheClient{
client: client,
serverList: &servers,
expiration: config.Expiration,
expiration: int32(config.Expiration.Seconds()),
hostname: config.Host,
service: config.Service,
quit: make(chan struct{}),

View File

@@ -28,7 +28,7 @@ import (
)
const (
memcacheExpiration = 15 // seconds
memcacheExpiration = 15 * time.Second
memcacheUpdateInterval = 1 * time.Minute
)