This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const apiInitPause = 100 * time.Millisecond // delay between api calls to avoid triggering API flood protection | |
const apiInitMult = 3 // magnitude of spread between random min-max calls to client init calls | |
const apiUrl = "https://api.com/token=123456759" | |
func initClients(ctx context.Context, tickers []string, events []chan *sse.Event) { | |
rand.Seed(time.Now().UTC().UnixNano()) | |
for _, v := range tickers { | |
apiInitPause := randInt(apiInitPause/apiInitMult, apiInitPause*apiInitMult) |