satellite/payments/stripe: another loop variable capture
Change-Id: I9ec7226befb8ebe18c7833b1c1d7ee8661bd9032
This commit is contained in:
parent
7d8f0845fd
commit
98032f2b1f
@ -662,21 +662,21 @@ func (service *Service) ApplyFreeTierCoupons(ctx context.Context) (err error) {
|
|||||||
nextCursor = customersPage.Cursor
|
nextCursor = customersPage.Cursor
|
||||||
|
|
||||||
for _, c := range customersPage.Customers {
|
for _, c := range customersPage.Customers {
|
||||||
cusID := c.ID
|
c := c
|
||||||
limiter.Go(ctx, func() {
|
limiter.Go(ctx, func() {
|
||||||
if inactive, err := service.isUserInactive(ctx, c.UserID); err != nil {
|
if inactive, err := service.isUserInactive(ctx, c.UserID); err != nil {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
failedUsers = append(failedUsers, cusID)
|
failedUsers = append(failedUsers, c.ID)
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
return
|
return
|
||||||
} else if inactive {
|
} else if inactive {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
applied, err := service.applyFreeTierCoupon(ctx, cusID)
|
applied, err := service.applyFreeTierCoupon(ctx, c.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
failedUsers = append(failedUsers, cusID)
|
failedUsers = append(failedUsers, c.ID)
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user