Metrics listener fix (#2036)

* Create test to verify correct listener behavior

* Create Unset function to remove todo items

* Reset address for prometheus listener before restarting

* Add inline documentation for Unset function

* Make shutdownTimeout a constant and change to five seconds

* Revert ForEach behavior in uniq package
This commit is contained in:
Zach Eddy 2018-08-21 08:52:25 -07:00 committed by Francois Tur
parent b87ed01bb2
commit 8aa55c5ff2
3 changed files with 108 additions and 13 deletions

View file

@ -24,6 +24,13 @@ func (u U) Set(key string, f func() error) {
u.u[key] = item{todo, f}
}
// Unset removes the 'todo' associated with a key
func (u U) Unset(key string) {
if _, ok := u.u[key]; ok {
delete(u.u, key)
}
}
// SetTodo sets key to 'todo' again.
func (u U) SetTodo(key string) {
v, ok := u.u[key]