Skip to content

Commit

Permalink
One time extend mining feature limit was decreased due to max args is…
Browse files Browse the repository at this point in the history
…sue.
  • Loading branch information
ice-myles committed Aug 12, 2024
1 parent 7d2f156 commit dd94fae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions notifications/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (s *Scheduler) runOneTimeMiningExtendFeature(ctx context.Context) {
ID string
Language string
}
const limit = 10000
const limit = 1000
offset := uint64(0)
now := time.Now()
for {
Expand All @@ -276,11 +276,12 @@ func (s *Scheduler) runOneTimeMiningExtendFeature(ctx context.Context) {
resp, err := storage.Select[notActiveUser](ctx, s.eskimoDB, sql, now)
if err != nil {
log.Error(err, "can't get users to send the single mining extend message")
stdlibtime.Sleep(100 * stdlibtime.Millisecond) //nolint:gomnd,mnd // .

continue
}
if len(resp) == 0 {
return
break
}
var randMax int
if s.cfg.Development {
Expand Down Expand Up @@ -310,7 +311,10 @@ func (s *Scheduler) runOneTimeMiningExtendFeature(ctx context.Context) {
}

offset += limit
stdlibtime.Sleep(100 * stdlibtime.Millisecond) //nolint:gomnd,mnd // .
}
diff := stdlibtime.Since(*now.Time)
log.Info("Finished handling one time mining extend notifications generation in", diff)
}

//nolint:dupl // .
Expand Down

0 comments on commit dd94fae

Please sign in to comment.