small fixes

This commit is contained in:
Samuel Tariku 2025-04-14 21:28:52 +03:00
parent 3f42d7e5c7
commit 5d2acd4645
3 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ coverage
tmp
build
*.log
db.sql

View File

@ -231,7 +231,8 @@ CREATE TABLE odds (
source TEXT DEFAULT 'b365api',
is_active BOOLEAN DEFAULT true,
UNIQUE (market_id, name, handicap),
UNIQUE (event_id, market_id, name, handicap)
UNIQUE (event_id, market_id, name, handicap),
UNIQUE (event_id, market_id)
);
ALTER TABLE refresh_tokens
ADD CONSTRAINT fk_refresh_tokens_users FOREIGN KEY (user_id) REFERENCES users(id);

View File

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