Commit 8b569f29 authored by Dustin L. Howett's avatar Dustin L. Howett

GetExpirable doesn't need to return an error value we were going to ignore anyway.

parent f2b29bf1
......@@ -48,12 +48,12 @@ func (e *EphemeralKeyValueStore) Delete(k string) {
delete(e.values, k)
}
func (e *EphemeralKeyValueStore) GetExpirable(id ExpirableID) (Expirable, error) {
func (e *EphemeralKeyValueStore) GetExpirable(id ExpirableID) Expirable {
_, ok := e.values[string(id)]
if !ok {
return nil, nil
return nil
}
return ephemeralExpirationProxy(id), nil
return ephemeralExpirationProxy(id)
}
func (e *EphemeralKeyValueStore) DestroyExpirable(ex Expirable) {
......
......@@ -34,7 +34,7 @@ type Expirable interface {
}
type ExpirableStore interface {
GetExpirable(ExpirableID) (Expirable, error)
GetExpirable(ExpirableID) Expirable
DestroyExpirable(Expirable)
}
......@@ -145,11 +145,9 @@ func (e *Expirator) run() {
e.saveExpirations()
}
case expiration := <-e.expirationChannel:
expirable, _ := e.store.GetExpirable(expiration.ID)
delete(e.expirationMap, expiration.ID)
if expirable != nil {
if expirable := e.store.GetExpirable(expiration.ID); expirable != nil {
e.store.DestroyExpirable(expirable)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment