Improve error handling across deal sources and increase CheapShark page size
Add proper error handling for price parsing, date parsing, and HTTP status codes in CheapShark, Epic, and ITAD integrations. Fix Epic dedup IDs to distinguish current vs upcoming offers. Bump CheapShark fetch page size from 10 to 60. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e452e36a63
commit
373939fedb
+2
-2
@@ -228,7 +228,7 @@ func main() {
|
||||
func populateInitialState(cfg *config.Config, db *database.DB) {
|
||||
// Record CheapShark deals without posting
|
||||
if cfg.HasSource("cheapshark") {
|
||||
rawDeals, err := deals.FetchCheapSharkDeals(cfg.MaxPriceUSD, 10)
|
||||
rawDeals, err := deals.FetchCheapSharkDeals(cfg.MaxPriceUSD, 60)
|
||||
if err != nil {
|
||||
slog.Warn("first run: cheapshark fetch failed", "error", err)
|
||||
} else {
|
||||
@@ -290,7 +290,7 @@ func checkCheapShark(cfg *config.Config, db *database.DB, mx *matrix.Client, con
|
||||
slog.Debug("checking cheapshark deals")
|
||||
conv.EnsureRates()
|
||||
|
||||
rawDeals, err := deals.FetchCheapSharkDeals(cfg.MaxPriceUSD, 10)
|
||||
rawDeals, err := deals.FetchCheapSharkDeals(cfg.MaxPriceUSD, 60)
|
||||
if err != nil {
|
||||
slog.Error("cheapshark fetch failed", "error", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user