update showDown

This commit is contained in:
Pavel 2024-05-06 23:35:08 +03:00
parent 0967dd996d
commit 4ebca588e2
8 changed files with 16 additions and 6 deletions

@ -152,6 +152,7 @@ func Run(ctx context.Context, config initialize.Config, logger *zap.Logger) erro
shutdownGroup.Add(closer.CloserFunc(server.Shutdown))
shutdownGroup.Add(closer.CloserFunc(amoRepo.Close))
shutdownGroup.Add(closer.CloserFunc(redisRepo.Close))
shutdownGroup.Add(closer.CloserFunc(rateLimiter.Stop))
shutdownGroup.Add(closer.CloserFunc(dataUpdater.Stop))
shutdownGroup.Add(closer.CloserFunc(queUpdater.Stop))

@ -124,3 +124,12 @@ func (r *Repository) FetchingDeals(ctx context.Context) (map[string][]models.Map
return dealsDataForUpdate, forRestoringMap, nil
}
func (r *Repository) Close(_ context.Context) error {
err := r.redisClient.Close()
if err != nil {
return err
}
return nil
}

@ -54,6 +54,6 @@ func (wc *DataUpdater) processTasks(ctx context.Context) {
}
}
func (wc *DataUpdater) Stop(ctx context.Context) error {
func (wc *DataUpdater) Stop(_ context.Context) error {
return nil
}

@ -53,6 +53,6 @@ func (limiter *RateLimiter) Check() bool {
}
}
func (limiter *RateLimiter) Stop(ctx context.Context) error {
func (limiter *RateLimiter) Stop(_ context.Context) error {
return nil
}

@ -166,6 +166,6 @@ func (wc *PostDeals) saveDealToDB(ctx context.Context, resp []models.DealResp, a
return nil
}
func (wc *PostDeals) Stop(ctx context.Context) error {
func (wc *PostDeals) Stop(_ context.Context) error {
return nil
}

@ -135,6 +135,6 @@ func (wc *PostFields) updateDealStatus(ctx context.Context, deps DealStatus) err
return nil
}
func (wc *PostFields) Stop(ctx context.Context) error {
func (wc *PostFields) Stop(_ context.Context) error {
return nil
}

@ -225,6 +225,6 @@ func (wc *QueueUpdater) processMessages(ctx context.Context, message models.Kafk
return nil
}
func (wc *QueueUpdater) Stop(ctx context.Context) error {
func (wc *QueueUpdater) Stop(_ context.Context) error {
return nil
}

@ -73,6 +73,6 @@ func (wc *Token) processTasks(ctx context.Context) {
//}
}
func (wc *Token) Stop(ctx context.Context) error {
func (wc *Token) Stop(_ context.Context) error {
return nil
}