This commit is contained in:
OneTap Technologies 2025-04-14 16:52:42 +03:00
parent b8d15695a4
commit d416a40cae
3 changed files with 29 additions and 22 deletions

View File

@ -19,17 +19,22 @@ INSERT INTO odds (
$1, $2, $3, $4, $5, $6, $7,
$8, $9, $10, $11, $12, $13, $14, $15
)
ON CONFLICT (market_id, name, handicap) DO UPDATE SET
ON CONFLICT (event_id, market_id) DO UPDATE SET
odds_value = EXCLUDED.odds_value,
raw_odds = EXCLUDED.raw_odds,
market_type = EXCLUDED.market_type,
market_name = EXCLUDED.market_name,
market_category = EXCLUDED.market_category,
name = EXCLUDED.name,
handicap = EXCLUDED.handicap,
fetched_at = EXCLUDED.fetched_at,
is_active = EXCLUDED.is_active,
source = EXCLUDED.source,
fi = EXCLUDED.fi;
-- name: GetPrematchOdds :many
SELECT
event_id,

View File

@ -295,12 +295,14 @@ INSERT INTO odds (
$1, $2, $3, $4, $5, $6, $7,
$8, $9, $10, $11, $12, $13, $14, $15
)
ON CONFLICT (market_id, name, handicap) DO UPDATE SET
ON CONFLICT (event_id, market_id) DO UPDATE SET
odds_value = EXCLUDED.odds_value,
raw_odds = EXCLUDED.raw_odds,
market_type = EXCLUDED.market_type,
market_name = EXCLUDED.market_name,
market_category = EXCLUDED.market_category,
name = EXCLUDED.name,
handicap = EXCLUDED.handicap,
fetched_at = EXCLUDED.fetched_at,
is_active = EXCLUDED.is_active,
source = EXCLUDED.source,

View File

@ -38,7 +38,7 @@ func StartDataFetchingCrons(eventService eventsvc.Service, oddsService oddssvc.S
// {
// spec: "*/30 * * * * *", // Every 30 seconds
// spec: "*/5 * * * * *", // Every 5 seconds
// task: func() {
// if err := oddsService.FetchNonLiveOdds(context.Background()); err != nil {
// log.Printf("FetchNonLiveOdds error: %v", err)