Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
fix: move metrics call so failures doesn't double call
Browse files Browse the repository at this point in the history
  • Loading branch information
Flydiverny committed Nov 3, 2019
1 parent 608c596 commit 37be08b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/poller.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ class Poller {

try {
await this._upsertKubernetesSecret()

this._metrics.observeSync({
name: this._name,
namespace: this._namespace,
backend: this._secretDescriptor.backendType,
status: 'success'
})
} catch (err) {
this._logger.error(err, `failure while polling the secret ${this._name}`)
this._metrics.observeSync({
Expand All @@ -111,13 +118,6 @@ class Poller {
if (!this._stopped) {
this._setNextPoll()
}

this._metrics.observeSync({
name: this._name,
namespace: this._namespace,
backend: this._secretDescriptor.backendType,
status: 'success'
})
}

/**
Expand Down

0 comments on commit 37be08b

Please sign in to comment.