|
|
@@ -101,7 +101,7 @@ const updateFiltedGames = async () => {
|
|
|
GLOBAL_DATA.filtedGames = games.map(game => game.eventId).filter(eventId => eventId);
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- Logs.err(err.message);
|
|
|
+ return Promise.reject(err);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
setTimeout(updateFiltedGames, 1000 * 30);
|
|
|
@@ -110,6 +110,9 @@ const updateFiltedGames = async () => {
|
|
|
|
|
|
|
|
|
const getStraightFixtures = async () => {
|
|
|
+ if (!GLOBAL_DATA.filtedLeagues.length) {
|
|
|
+ return Promise.reject(new Error('No filted leagues'));
|
|
|
+ }
|
|
|
const leagueIds = GLOBAL_DATA.filtedLeagues.join(',');
|
|
|
let since = GLOBAL_DATA.straightFixturesVersion;
|
|
|
if (GLOBAL_DATA.straightFixturesCount > 12) {
|
|
|
@@ -170,6 +173,9 @@ const updateStraightFixtures = async () => {
|
|
|
|
|
|
|
|
|
const getStraightOdds = async () => {
|
|
|
+ if (!GLOBAL_DATA.filtedLeagues.length) {
|
|
|
+ return Promise.reject(new Error('No filted leagues'));
|
|
|
+ }
|
|
|
const leagueIds = GLOBAL_DATA.filtedLeagues.join(',');
|
|
|
const since = GLOBAL_DATA.straightOddsVersion;
|
|
|
return pinnacleGet('/v3/odds', { sportId: 29, oddsFormat: 'Decimal', leagueIds, since })
|
|
|
@@ -207,6 +213,9 @@ const updateStraightOdds = async () => {
|
|
|
|
|
|
|
|
|
const getSpecialFixtures = async () => {
|
|
|
+ if (!GLOBAL_DATA.filtedLeagues.length) {
|
|
|
+ return Promise.reject(new Error('No filted leagues'));
|
|
|
+ }
|
|
|
const leagueIds = GLOBAL_DATA.filtedLeagues.join(',');
|
|
|
let since = GLOBAL_DATA.specialFixturesVersion;
|
|
|
if (GLOBAL_DATA.specialFixturesCount > 18) {
|
|
|
@@ -328,6 +337,9 @@ const updateSpecialFixtures = async () => {
|
|
|
|
|
|
|
|
|
const getSpecialsOdds = async () => {
|
|
|
+ if (!GLOBAL_DATA.filtedLeagues.length) {
|
|
|
+ return Promise.reject(new Error('No filted leagues'));
|
|
|
+ }
|
|
|
const leagueIds = GLOBAL_DATA.filtedLeagues.join(',');
|
|
|
const since = GLOBAL_DATA.specialsOddsVersion;
|
|
|
return pinnacleGet('/v2/odds/special', { sportId: 29, oddsFormat: 'Decimal', leagueIds, since })
|