import Logs from "../libs/logs.js"; import ProcessData from "../libs/processData.js"; import { getPassableEvents, eventsCombination } from "./trangleCalc.js"; const processData = new ProcessData(process, 'triangle'); // setInterval(() => { // Logs.outDev('get games relations'); // processData.get('gamesRelations') // .then(relations => { // Logs.outDev('relations', relations); // }) // .catch(error => { // Logs.err('triangle error', error); // }); // }, 5000); const eventMatch = () => { processData.get('gamesRelations') .then(relations => { if (!relations?.length) { Logs.outDev('relation list is empty'); } // Logs.outDev('relations', relations); const passableEvents = getPassableEvents(relations); const solutions = eventsCombination(passableEvents); if (solutions?.length) { processData.post('solutions', solutions); } }) .finally(() => { setTimeout(() => { eventMatch(); }, 2000); }); } eventMatch();