Skip to content

Commit 12a4efb

Browse files
authored
fix(api,cdn): restart some goroutines (#5852)
1 parent 09c1cf0 commit 12a4efb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

engine/api/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ func (a *API) Serve(ctx context.Context) error {
801801
func(ctx context.Context) {
802802
services.Pings(ctx, a.mustDB, externalServices)
803803
})
804-
a.GoRoutines.Run(ctx, "workflow.Initialize",
804+
a.GoRoutines.RunWithRestart(ctx, "workflow.Initialize",
805805
func(ctx context.Context) {
806806
workflow.SetMaxRuns(a.Config.Workflow.MaxRuns)
807807
workflow.Initialize(ctx, a.DBConnectionFactory.GetDBMap(gorpmapping.Mapper), a.Cache, a.Config.URL.UI, a.Config.DefaultOS, a.Config.DefaultArch, a.Config.Log.StepMaxSize)

engine/api/status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func (api *API) computeMetrics(ctx context.Context) {
279279
log.Error(ctx, "api.computeMetrics> unable to tag observability context: %v", err)
280280
}
281281

282-
api.GoRoutines.Run(ctx, "api.computeMetrics", func(ctx context.Context) {
282+
api.GoRoutines.RunWithRestart(ctx, "api.computeMetrics", func(ctx context.Context) {
283283
tick := time.NewTicker(9 * time.Second).C
284284
for {
285285
select {

engine/cdn/cdn_metrics.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (s *Service) initMetrics(ctx context.Context) error {
6565
itemUnitToDeleteView := telemetry.NewViewLast(s.Metrics.ItemUnitToDelete.Name(), s.Metrics.ItemUnitToDelete, []tag.Key{tagStorage, tagItemType})
6666

6767
if s.DBConnectionFactory != nil {
68-
s.GoRoutines.Run(ctx, "cds-compute-metrics", func(ctx context.Context) {
68+
s.GoRoutines.RunWithRestart(ctx, "cds-compute-metrics", func(ctx context.Context) {
6969
s.ComputeMetrics(ctx)
7070
})
7171
}

0 commit comments

Comments
 (0)