deployment fix
This commit is contained in:
parent
b4e20a274d
commit
889427af26
|
|
@ -33,7 +33,7 @@ import (
|
|||
)
|
||||
|
||||
// @title FortuneBet API
|
||||
// @version 1.0
|
||||
// @version 1.0.1
|
||||
// @description This is server for FortuneBet.
|
||||
// @termsOfService http://swagger.io/terms/
|
||||
// @contact.name API Support
|
||||
|
|
|
|||
|
|
@ -4932,7 +4932,7 @@ const docTemplate = `{
|
|||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "1.0",
|
||||
Version: "1.0.1",
|
||||
Host: "",
|
||||
BasePath: "",
|
||||
Schemes: []string{},
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Apache 2.0",
|
||||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
},
|
||||
"version": "1.0"
|
||||
"version": "1.0.1"
|
||||
},
|
||||
"paths": {
|
||||
"/admin": {
|
||||
|
|
|
|||
|
|
@ -1135,7 +1135,7 @@ info:
|
|||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
termsOfService: http://swagger.io/terms/
|
||||
title: FortuneBet API
|
||||
version: "1.0"
|
||||
version: 1.0.1
|
||||
paths:
|
||||
/admin:
|
||||
get:
|
||||
|
|
|
|||
|
|
@ -100,14 +100,13 @@ func (s *service) FetchLiveEvents(ctx context.Context) error {
|
|||
|
||||
func (s *service) FetchUpcomingEvents(ctx context.Context) error {
|
||||
sportIDs := []int{1, 18}
|
||||
|
||||
var totalPages int = 1
|
||||
var page int = 0
|
||||
var limit int = 100
|
||||
var count int = 0
|
||||
for _, sportID := range sportIDs {
|
||||
var totalPages int = 1
|
||||
var page int = 0
|
||||
var limit int = 100
|
||||
var count int = 0
|
||||
for page != totalPages {
|
||||
// time.Sleep(1 * time.Second) //This will restrict the fetching to 1200 requests per hour
|
||||
time.Sleep(3 * time.Second) //This will restrict the fetching to 1200 requests per hour
|
||||
|
||||
page = page + 1
|
||||
url := fmt.Sprintf("https://api.b365api.com/v1/bet365/upcoming?sport_id=%d&token=%s&page=%d", sportID, s.token, page)
|
||||
|
|
@ -150,7 +149,6 @@ func (s *service) FetchUpcomingEvents(ctx context.Context) error {
|
|||
}
|
||||
skippedLeague := 0
|
||||
for _, ev := range data.Results {
|
||||
|
||||
startUnix, _ := strconv.ParseInt(ev.Time, 10, 64)
|
||||
// eventID, err := strconv.ParseInt(ev.ID, 10, 64)
|
||||
// if err != nil {
|
||||
|
|
@ -198,7 +196,6 @@ func (s *service) FetchUpcomingEvents(ctx context.Context) error {
|
|||
break
|
||||
}
|
||||
count++
|
||||
log.Printf("Skipped leagues %d", skippedLeague)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,14 +84,13 @@ func (s *ServiceImpl) storeSection(ctx context.Context, eventID, fi, sectionName
|
|||
if len(market.Odds) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
marketRecord := domain.Market{
|
||||
EventID: eventID,
|
||||
FI: fi,
|
||||
MarketCategory: sectionName,
|
||||
MarketType: marketType,
|
||||
MarketName: market.Name,
|
||||
MarketID: market.ID,
|
||||
MarketID: market.ID.String(),
|
||||
UpdatedAt: updatedAt,
|
||||
Odds: market.Odds,
|
||||
}
|
||||
|
|
@ -101,7 +100,7 @@ func (s *ServiceImpl) storeSection(ctx context.Context, eventID, fi, sectionName
|
|||
}
|
||||
|
||||
type OddsMarket struct {
|
||||
ID string `json:"id"`
|
||||
ID json.Number `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Odds []json.RawMessage `json:"odds"`
|
||||
Header string `json:"header,omitempty"`
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ func (s *Service) FetchAndProcessResults(ctx context.Context) error {
|
|||
s.logger.Error("Failed to fetch events")
|
||||
return err
|
||||
}
|
||||
fmt.Printf("Expired Events: %d \n", len(events))
|
||||
|
||||
for _, event := range events {
|
||||
eventID, err := strconv.ParseInt(event.ID, 10, 64)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user