mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Use background context for maintenance function (#64065)
This commit is contained in:
parent
e9ed76722d
commit
e760f22402
@ -103,7 +103,8 @@ func newAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store A
|
||||
retention: retentionNotificationsAndSilences,
|
||||
maintenanceFrequency: silenceMaintenanceInterval,
|
||||
maintenanceFunc: func(state alertingNotify.State) (int64, error) {
|
||||
return fileStore.Persist(ctx, silencesFilename, state)
|
||||
// Detached context here is to make sure that when the service is shut down the persist operation is executed.
|
||||
return fileStore.Persist(context.Background(), silencesFilename, state)
|
||||
},
|
||||
}
|
||||
|
||||
@ -112,7 +113,8 @@ func newAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store A
|
||||
retention: retentionNotificationsAndSilences,
|
||||
maintenanceFrequency: notificationLogMaintenanceInterval,
|
||||
maintenanceFunc: func(state alertingNotify.State) (int64, error) {
|
||||
return fileStore.Persist(ctx, notificationLogFilename, state)
|
||||
// Detached context here is to make sure that when the service is shut down the persist operation is executed.
|
||||
return fileStore.Persist(context.Background(), notificationLogFilename, state)
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user