aboutsummaryrefslogtreecommitdiff
path: root/backend/internal/ibd/ibd50.go
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@anshulg.com> 2024-08-07 17:48:57 -0700
committerGravatar Anshul Gupta <ansg191@anshulg.com> 2024-08-07 18:48:10 -0700
commite9ee45b9d2bd494332dcf8b2073714f92fd0738d (patch)
treed34af1af84984409d27003981538f13cde4ba218 /backend/internal/ibd/ibd50.go
parent3de4ebb7560851ccbefe296c197456fe80c22901 (diff)
downloadibd-trader-e9ee45b9d2bd494332dcf8b2073714f92fd0738d.tar.gz
ibd-trader-e9ee45b9d2bd494332dcf8b2073714f92fd0738d.tar.zst
ibd-trader-e9ee45b9d2bd494332dcf8b2073714f92fd0738d.zip
Refactor DB to remove restrictive query system
Diffstat (limited to 'backend/internal/ibd/ibd50.go')
-rw-r--r--backend/internal/ibd/ibd50.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/internal/ibd/ibd50.go b/backend/internal/ibd/ibd50.go
index ea02f82..52e28aa 100644
--- a/backend/internal/ibd/ibd50.go
+++ b/backend/internal/ibd/ibd50.go
@@ -9,6 +9,8 @@ import (
"net/http"
"net/url"
"strconv"
+
+ "github.com/ansg191/ibd-trader-backend/internal/database"
)
const ibd50Url = "https://research.investors.com/Services/SiteAjaxService.asmx/GetIBD50?sortcolumn1=%22ibd100rank%22&sortOrder1=%22asc%22&sortcolumn2=%22%22&sortOrder2=%22ASC%22"
@@ -63,7 +65,7 @@ func (c *Client) GetIBD50(ctx context.Context) ([]*Stock, error) {
// If there are less than 10 stocks in the IBD50 list, it's likely that authentication failed.
if len(ibd50Resp.D.ETablesDataList) < 10 {
// Report cookie failure to DB
- if err = c.cookies.ReportCookieFailure(ctx, cookieId); err != nil {
+ if err = database.ReportCookieFailure(ctx, c.db, cookieId); err != nil {
slog.Error("Failed to report cookie failure", "error", err)
}
return nil, errors.New("failed to get IBD50 list")