mirror of
https://github.com/idanoo/NZCovidBot
synced 2025-07-02 11:42:15 +00:00
Batch discord data to 20 locations at a time
This commit is contained in:
parent
fdad4bffbb
commit
4c283f1cbb
2 changed files with 14 additions and 6 deletions
|
@ -42,13 +42,15 @@ func postTheUpdates() {
|
|||
|
||||
// Discord
|
||||
postableDiscordData := getPostableDiscordData()
|
||||
if postableDiscordData == "" {
|
||||
if len(postableDiscordData) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
// Not using go routines so we don't get rate limited
|
||||
for _, discordWebhook := range DiscordWebhooks {
|
||||
postToDiscord(discordWebhook, postableDiscordData)
|
||||
for _, postableData := range postableDiscordData {
|
||||
go postToDiscord(discordWebhook, postableData)
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
// Clear out posted data!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue