This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2021-08-21 14:17:30 +00:00
|
|
|
package ak
|
|
|
|
|
|
|
|
import (
|
2023-01-23 19:36:30 +00:00
|
|
|
"context"
|
2021-08-21 14:17:30 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (a *APIController) startPeriodicalTasks() {
|
2023-01-23 19:36:30 +00:00
|
|
|
ctx, canc := context.WithCancel(context.Background())
|
|
|
|
defer canc()
|
|
|
|
go a.Server.TimerFlowCacheExpiry(ctx)
|
|
|
|
for range time.Tick(time.Duration(a.GlobalConfig.CacheTimeoutFlows) * time.Second) {
|
|
|
|
a.logger.WithField("timer", "cache-timeout").Debug("Running periodical tasks")
|
|
|
|
a.Server.TimerFlowCacheExpiry(ctx)
|
|
|
|
}
|
2021-08-21 14:17:30 +00:00
|
|
|
}
|