Skip to content

Commit

Permalink
hotfix: temporary debugging for 30066 events
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Feb 12, 2024
1 parent 28278be commit daa0eb4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
7 changes: 4 additions & 3 deletions apps/nocapd/src/classes/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
17 changes: 14 additions & 3 deletions packages/publisher/src/kinds/Kind30066.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit daa0eb4

Please sign in to comment.