Skip to content

Commit

Permalink
[FAB-7928] Eventhub reg. unexpectedly fails
Browse files Browse the repository at this point in the history
Eventhub registrations unexpectedly fail when peer.events.timewindow
is not set. This CR adds a default value of 15 minutes for the time
window to ensure that the peer does not default to 0 seconds, which
makes it impossible to register successfully.

Change-Id: I03b5ddda952bb4b62995f001202d94c7a7c262ee
Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
  • Loading branch information
wlahti committed Jan 29, 2018
1 parent b23f581 commit 3633f35
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions peer/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,12 @@ func initializeEventsServerConfig(mutualTLS bool) *producer.EventsServerConfig {
TimeWindow: viper.GetDuration("peer.events.timewindow"),
BindingInspector: comm.NewBindingInspector(mutualTLS, extract)}

if ehConfig.TimeWindow == 0*time.Minute {
defaultTimeWindow := 15 * time.Minute
logger.Warningf("`peer.events.timewindow` not set; defaulting to %s", defaultTimeWindow)
ehConfig.TimeWindow = defaultTimeWindow
}

return ehConfig
}

Expand Down

0 comments on commit 3633f35

Please sign in to comment.