Mercurial > gemma
comparison pkg/common/attributes.go @ 1985:8eeb0b5eb340
Imports: Made retries and the waiting between the attempts configurable.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 23 Jan 2019 17:58:57 +0100 |
parents | 49e047c2106e |
children | 74e24ae3205a |
comparison
equal
deleted
inserted
replaced
1983:f9f1babe52ae | 1985:8eeb0b5eb340 |
---|---|
65 log.Printf("error: %v\n", err) | 65 log.Printf("error: %v\n", err) |
66 return 0, false | 66 return 0, false |
67 } | 67 } |
68 return i, true | 68 return i, true |
69 } | 69 } |
70 | |
71 func (ca Attributes) Duration(key string) (time.Duration, bool) { | |
72 s, found := ca.Get(key) | |
73 if !found { | |
74 return 0, false | |
75 } | |
76 d, err := time.ParseDuration(s) | |
77 if err != nil { | |
78 log.Printf("error: %v\n", err) | |
79 return 0, false | |
80 } | |
81 return d, true | |
82 } |