Use new microtask function in api module

This commit is contained in:
Daniel 2022-08-01 11:37:53 +02:00
parent aabd4fef77
commit 01c4fc75da

View file

@ -433,8 +433,7 @@ func updateAPIKeys(_ context.Context, _ interface{}) error {
} }
if hasExpiredKeys { if hasExpiredKeys {
name := "api-key-cleanup" module.StartLowPriorityMicroTask("api key cleanup", 0, func(ctx context.Context) error {
module.StartLowPriorityMicroTask(&name, func(ctx context.Context) error {
if err := config.SetConfigOption(CfgAPIKeys, validAPIKeys); err != nil { if err := config.SetConfigOption(CfgAPIKeys, validAPIKeys); err != nil {
log.Errorf("api: failed to remove expired API keys: %s", err) log.Errorf("api: failed to remove expired API keys: %s", err)
} else { } else {