read all elements
parent
9ccb5101ec
commit
2debac3055
|
@ -111,7 +111,7 @@ func (c *Client) GetAccountFollowers(ctx context.Context, id int64) ([]*Account,
|
|||
if !next {
|
||||
break
|
||||
}
|
||||
time.Sleep(10 * time.Second)
|
||||
time.Sleep(c.interval)
|
||||
}
|
||||
return total, nil
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Config is a setting for access mastodon APIs.
|
||||
|
@ -27,6 +28,7 @@ type Config struct {
|
|||
type Client struct {
|
||||
http.Client
|
||||
config *Config
|
||||
interval time.Duration
|
||||
}
|
||||
|
||||
type page struct {
|
||||
|
@ -135,6 +137,7 @@ func NewClient(config *Config) *Client {
|
|||
return &Client{
|
||||
Client: *http.DefaultClient,
|
||||
config: config,
|
||||
interval: 10 * time.Second,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue