list by pages and rate req limits
This commit is contained in:
15
internal/common/xcontext/wait.go
Normal file
15
internal/common/xcontext/wait.go
Normal file
@ -0,0 +1,15 @@
|
||||
package xcontext
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Wait(ctx context.Context, wait time.Duration) error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
case <-time.After(wait):
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user