From c139d7b71379cd474ea69be7418b17bc44aa7a0e Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sun, 12 Nov 2023 13:06:30 -0700 Subject: [PATCH] prevent fast retry when questrade login fails --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8a66a5e..350ba96 100644 --- a/main.go +++ b/main.go @@ -71,7 +71,9 @@ func main() { // Questrade authentication needs to be refreshed and persistentData written to disk in case app restarts questradeClient, err = questrade.NewClient(persistentData.QuestradeRefreshToken) if err != nil { - log.Fatalf("failed to create questrade client: %v", err) + log.Printf("failed to create questrade client: %v", err) + time.Sleep(time.Minute * 5) // prevent multiple fast login failures + continue } persistentData.QuestradeRefreshToken = questradeClient.Credentials.RefreshToken