|
|
@@ -1,24 +1,26 @@
|
|
|
-const axios = require('axios');
|
|
|
-const Logs = require('../libs/logs');
|
|
|
-const Cache = require('../libs/cache');
|
|
|
-const Setting = require('./Setting');
|
|
|
-const OddsHistory = require('./OddsHistory');
|
|
|
-const { eventSolutions } = require('../triangle/eventSolutions');
|
|
|
-const { getPassableEvents, eventsCombination, extractOdds } = require('../triangle/trangleCalc');
|
|
|
-const { calcTotalProfit, calcTotalProfitWithFixedFirst, getFirstInfo } = require('../triangle/totalProfitCalc');
|
|
|
-const { getSetting, updateSetting } = require('../triangle/settings');
|
|
|
-
|
|
|
-const fs = require('fs');
|
|
|
-const path = require('path');
|
|
|
-
|
|
|
+import axios from 'axios';
|
|
|
+import path from 'path';
|
|
|
+import { fork } from 'child_process';
|
|
|
+import { fileURLToPath } from 'url';
|
|
|
+import Logs from '../libs/logs.js';
|
|
|
+import Cache from '../libs/cache.js';
|
|
|
+import Setting from './Setting.js';
|
|
|
+import OddsHistory from './OddsHistory.js';
|
|
|
+import { eventSolutions } from '../triangle/eventSolutions.js';
|
|
|
+import { getPassableEvents, eventsCombination, extractOdds } from '../triangle/trangleCalc.js';
|
|
|
+import { calcTotalProfit, calcTotalProfitWithFixedFirst, getFirstInfo } from '../triangle/totalProfitCalc.js';
|
|
|
+import { getSetting, updateSetting } from '../triangle/settings.js';
|
|
|
+
|
|
|
+const __filename = fileURLToPath(import.meta.url);
|
|
|
+const __dirname = path.dirname(__filename);
|
|
|
const GamesCacheFile = path.join(__dirname, '../data/games.cache');
|
|
|
|
|
|
const childOptions = process.env.NODE_ENV == 'development' ? {
|
|
|
execArgv: ['--inspect=9230'],
|
|
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
|
|
} : {};
|
|
|
-const { fork } = require('child_process');
|
|
|
-const events_child = fork('./triangle/eventsMatch.js', [], childOptions);
|
|
|
+const eventsChildPath = path.join(__dirname, '../triangle/eventsMatch.js');
|
|
|
+const events_child = fork(eventsChildPath, [], childOptions);
|
|
|
|
|
|
const PS_IOR_KEYS = [
|
|
|
['0', 'ior_mh', 'ior_mn', 'ior_mc'],
|
|
|
@@ -1761,7 +1763,7 @@ process.on('SIGUSR2', () => {
|
|
|
});
|
|
|
|
|
|
|
|
|
-module.exports = {
|
|
|
+const GamesPs = {
|
|
|
updateLeaguesList, getFilteredLeagues,
|
|
|
updateGamesList, updateGamesEvents, updateBaseEvents,
|
|
|
getGamesRelation,
|
|
|
@@ -1771,4 +1773,18 @@ module.exports = {
|
|
|
getOddsHistory, getOddsHistoryGames,
|
|
|
getTotalProfitWithSid, getTotalProfitWithBetInfo, getTotalReplacement,
|
|
|
notifyException,
|
|
|
-}
|
|
|
+};
|
|
|
+
|
|
|
+export {
|
|
|
+ updateLeaguesList, getFilteredLeagues,
|
|
|
+ updateGamesList, updateGamesEvents, updateBaseEvents,
|
|
|
+ getGamesRelation,
|
|
|
+ updateGamesResult,
|
|
|
+ updateOriginalData, getOriginalData,
|
|
|
+ getSolutions, getGamesSolutions, getSolution, getSolutionsByIds,
|
|
|
+ getOddsHistory, getOddsHistoryGames,
|
|
|
+ getTotalProfitWithSid, getTotalProfitWithBetInfo, getTotalReplacement,
|
|
|
+ notifyException,
|
|
|
+};
|
|
|
+
|
|
|
+export default GamesPs;
|