diff --git a/internal/shared/db/model/setup.go b/internal/shared/db/model/setup.go index 62420e6b..d2516cb2 100644 --- a/internal/shared/db/model/setup.go +++ b/internal/shared/db/model/setup.go @@ -59,9 +59,9 @@ var collections = map[string][]index{ V1BtcInfoCollection: {{Indexes: map[string]int{}}}, // V2 V2StatsLockCollection: {{Indexes: map[string]int{}}}, - V2StakerStatsCollection: {{Indexes: map[string]int{}}}, - V2FinalityProviderStatsCollection: {{Indexes: map[string]int{"active_tvl": -1}, Unique: false}}, V2OverallStatsCollection: {{Indexes: map[string]int{}}}, + V2FinalityProviderStatsCollection: {{Indexes: map[string]int{"active_tvl": -1}, Unique: false}}, + V2StakerStatsCollection: {{Indexes: map[string]int{"active_tvl": -1}, Unique: false}}, } func Setup(ctx context.Context, cfg *config.Config) error { diff --git a/internal/v2/queue/handler/stats.go b/internal/v2/queue/handler/stats.go index 7f9b0dcd..4a297054 100644 --- a/internal/v2/queue/handler/stats.go +++ b/internal/v2/queue/handler/stats.go @@ -23,7 +23,7 @@ func (h *V2QueueHandler) ActiveStakingHandler(ctx context.Context, messageBody s // Mark as v1 delegation as transitioned if it exists if err := h.Services.V2Service.MarkV1DelegationAsTransitioned(ctx, activeStakingEvent.StakingTxHashHex); err != nil { log.Ctx(ctx).Error().Err(err).Msg("Failed to mark v1 delegation as transitioned") - return err + return types.NewError(http.StatusInternalServerError, types.InternalServiceError, err) } // TODO: Perform the address lookup conversion diff --git a/internal/v2/queue/queue.go b/internal/v2/queue/queue.go index 0deda0df..81af62a8 100644 --- a/internal/v2/queue/queue.go +++ b/internal/v2/queue/queue.go @@ -43,7 +43,7 @@ func New(cfg *queueConfig.QueueConfig, service *services.Services) *Queues { handlers := v2queuehandler.NewV2QueueHandler(service) return &Queues{ Handlers: handlers, - processingTimeout: time.Duration(cfg.QueueProcessingTimeout) * time.Second, + processingTimeout: cfg.QueueProcessingTimeout, maxRetryAttempts: cfg.MsgMaxRetryAttempts, ActiveStakingQueueClient: activeStakingQueueClient, UnbondingStakingQueueClient: unbondingStakingQueueClient,