From 211f206e86a786cfb296cb4d390a9087b51e5b12 Mon Sep 17 00:00:00 2001 From: inmake Date: Mon, 10 Jun 2024 19:36:39 +0500 Subject: [PATCH] upd --- .gitignore | 3 ++- dist/index.js | 4 ++-- src/index.ts | 6 ++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 30bc162..76add87 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/node_modules \ No newline at end of file +node_modules +dist \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index a0a98fd..392b80c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -208,7 +208,7 @@ async function checkScheduledSessions() { .get(`https://coord.graff.tech/start?build=${build}&location=a1`) .json(); if (!result.stream) { - console.log("Not result"); + console.log("Not result.stream"); return; } const result2 = await got_cjs_1.default @@ -218,7 +218,7 @@ async function checkScheduledSessions() { }, }) .json(); - console.log("CRON Start session: ", result2); + console.log("result2: ", result2); } else if ((0, date_fns_1.isAfter)(new Date(), (0, date_fns_1.parseISO)(session.endAt))) { const result = await got_cjs_1.default diff --git a/src/index.ts b/src/index.ts index b4395cb..cbbb806 100644 --- a/src/index.ts +++ b/src/index.ts @@ -242,21 +242,19 @@ async function checkScheduledSessions() { .json(); if (!result.stream) { - console.log("Not result"); + console.log("Not result.stream"); return; } const result2 = await got .put(`${process.env.CRM_API_URL}/scheduled_sessions/${session.id}`, { json: { - startAt: session.startAt, - endAt: session.endAt, activeSessionId: result.stream, }, }) .json(); - console.log("CRON Start session: ", result2); + console.log("result2: ", result2); } else if (isAfter(new Date(), parseISO(session.endAt))) { const result = await got .post(