Skip to content

Commit

Permalink
Add config for gracePeriod and timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Schultz <hello@schultzie.dev>
  • Loading branch information
dylanschultzie committed May 3, 2023
1 parent 554c8d5 commit 9693c2e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/autostake/Health.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { timeStamp } from '../utils/Helpers.mjs'

class Health {
constructor(config, opts) {
const { address, uuid, name, apiKey } = config || {}
const { address, uuid, name, apiKey, timeout, gracePeriod } = config || {}
const { dryRun, networkName } = opts || {}
this.address = address || 'https://hc-ping.com'
this.uuid = uuid
this.name = name || networkName
this.gracePeriod = gracePeriod || 86400 // default 24 hours
this.timeout = timeout || 86400 // default 24 hours
this.uuid = uuid
this.apiKey = apiKey
this.dryRun = dryRun
this.logs = []
Expand Down Expand Up @@ -57,7 +59,7 @@ class Health {
}

let data = {
"name": this.name, "channels": "*", "timeout": 43200, "grace": 86400, "unique": ["name"]
"name": this.name, "channels": "*", "timeout": this.timeout, "grace": this.gracePeriod, "unique": ["name"]
}

try {
Expand Down

0 comments on commit 9693c2e

Please sign in to comment.