mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Make expiration a Duration
This commit is contained in:
@@ -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{}),
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
memcacheExpiration = 15 // seconds
|
||||
memcacheExpiration = 15 * time.Second
|
||||
memcacheUpdateInterval = 1 * time.Minute
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user