Skip to content

Commit 1ee632d

Browse files
committed
participant: Support MSGFLO_DISCOVERY_PERIOD envvar
1 parent cac55e6 commit 1ee632d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/participant.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ instantiateDefinition = (d, role) ->
4949

5050
return def
5151

52+
defaultDiscoveryPeriod = 60
53+
defaultDiscoveryPeriod = parseInt process.env.MSGFLO_DISCOVERY_PERIOD if process.env.MSGFLO_DISCOVERY_PERIOD
54+
5255
class Participant extends EventEmitter
5356
# @func gets called with inport, , and should return outport, outdata
5457
constructor: (client, def, @func, role, options={}) ->
@@ -60,7 +63,7 @@ class Participant extends EventEmitter
6063
newrelic = require './newrelic'
6164
@_transactions = new newrelic.Transactions @definition
6265
@options = options
63-
@options.discoveryPeriod = 60 if not @options.discoveryPeriod # seconds
66+
@options.discoveryPeriod = defaultDiscoveryPeriod if not @options.discoveryPeriod # seconds
6467

6568
start: (callback) ->
6669
@messaging.connect (err) =>

0 commit comments

Comments
 (0)