mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-25 04:59:05 +01:00
mi: bound every query with a timeout and add context cancellation (#2738)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -176,7 +176,7 @@ func (application *Application) NewSession(options *DestinationOptions) (*Sessio
|
||||
return nil, fmt.Errorf("failed to create default operation options: %w", err)
|
||||
}
|
||||
|
||||
if err = defaultOperationOptions.SetTimeout(5 * time.Second); err != nil {
|
||||
if err = defaultOperationOptions.SetTimeout(DefaultQueryTimeout); err != nil {
|
||||
_ = defaultOperationOptions.Delete()
|
||||
_ = session.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user