From daa0eb44e8f33eeff24d1fef3b161dff22a15271 Mon Sep 17 00:00:00 2001 From: sandwich <299465+dskvr@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:37:12 +0000 Subject: [PATCH] hotfix: temporary debugging for 30066 events --- apps/nocapd/src/classes/Worker.js | 7 ++++--- packages/publisher/src/kinds/Kind30066.js | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/nocapd/src/classes/Worker.js b/apps/nocapd/src/classes/Worker.js index 7a98b6aa..d269d5c5 100644 --- a/apps/nocapd/src/classes/Worker.js +++ b/apps/nocapd/src/classes/Worker.js @@ -106,6 +106,7 @@ export class NWWorker { if(!result || !result?.connect?.data) return this.on_failed(job, new Error(`Nocap.check('${this.slug}'): failed for ${url}`)) + // console.log('PUBLISHING', url, result?.connect?.data, result?.read?.data, result?.write?.data) const { checked_at } = result @@ -118,9 +119,9 @@ export class NWWorker { this.processed++ - const relay_id = await this.updateRelayCache(result) - const retry_id = await this.retry.setRetries( url, true ) - const lastChecked_id = await this.setLastChecked( url, Date.now() ) + await this.updateRelayCache(result) + await this.retry.setRetries( url, true ) + await this.setLastChecked( url, Date.now() ) this.progressMessage(url, result) diff --git a/packages/publisher/src/kinds/Kind30066.js b/packages/publisher/src/kinds/Kind30066.js index 43783870..dd7c8f61 100644 --- a/packages/publisher/src/kinds/Kind30066.js +++ b/packages/publisher/src/kinds/Kind30066.js @@ -39,8 +39,8 @@ export class Kind30066 extends Publisher { static generateTags(data){ let tags = [] - const isRtt = data?.connect?.data === true || data?.connect?.duration > 0 - const isDns = Object.keys(data?.dns || {})?.length > 0 + const isRtt = data?.connect?.data + const isDns = Object.keys(data?.dns?.data || {})?.length > 0 const isInfo = Object.keys(data?.info?.data || {})?.length > 0 const isGeo = Object.keys(data?.geo?.data || {})?.length > 0 const isSsl = Object.keys(data?.ssl?.data || {})?.length > 0 @@ -170,7 +170,18 @@ export class Kind30066 extends Publisher { tags.push( [ 'ssl', prop, val? 'true': 'false' ] ) } } - } + } + + const countRttTags = tags.filter( tag => tag[0] === 'rtt' )?.length + + console.log(data.url, countRttTags) + + if(!countRttTags || countRttTags == 0){ + console.log(data) + console.log(tags) + process.exit() + } + return tags }