page timeout added

This commit is contained in:
nquidox 2026-02-28 23:33:22 +03:00
parent 56309cafb9
commit f466566505
3 changed files with 17 additions and 9 deletions

View file

@ -75,9 +75,6 @@ func (app *App) Run(ctx context.Context) {
//main
apiClient := newApiClient(app.config.GrpcCfg.ApiClientHost + ":" + app.config.GrpcCfg.ApiClientPort)
period := time.NewTicker(app.checkPeriod * time.Hour)
defer period.Stop()
sender := make(chan shared.TaskResult, app.numCPUs*10)
defer close(sender)
@ -96,6 +93,7 @@ func (app *App) Run(ctx context.Context) {
Enabled: app.config.OriginEnabled.Mandarake,
ExternalBrowser: app.config.ExternalBrowser,
GoroutinesNumber: app.numCPUs,
TaskTimeout: app.config.TasksCfg.TaskTimeout,
})
}
@ -117,6 +115,9 @@ func (app *App) Run(ctx context.Context) {
taskProcessor.StartWork(ctx, receivedTasks)
}
period := time.NewTicker(app.checkPeriod * time.Hour)
defer period.Stop()
go func() {
process() //immediate start
for range period.C {