Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster API integration to allow TCP ports to be shared #451

Merged
merged 7 commits into from
Mar 26, 2015
3 changes: 3 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,8 @@
},
"tlsClientLookup": {
"type": "strict"
},
"agenda": {
"startupDelay": 500
}
}
2 changes: 1 addition & 1 deletion config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"atnaUrl": "mongodb://localhost/openhim-development"
},
"logger": {
"level": "info"
"level": "debug"
},
"statsd": {
"host": "127.0.0.1"
Expand Down
3 changes: 3 additions & 0 deletions config/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
},
"caching": {
"enabled": false
},
"agenda": {
"startupDelay": 0
}
}
8 changes: 4 additions & 4 deletions src/api/channels.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports.getChannels = ->
processPostAddTriggers = (channel) ->
if channel.type and authMiddleware.isChannelEnabled channel
if (channel.type is 'tcp' or channel.type is 'tls') and server.isTcpHttpReceiverRunning()
tcpAdapter.startupTCPServer channel._id, (err) -> logger.error err if err
tcpAdapter.notifyMasterToStartTCPServer channel._id, (err) -> logger.error err if err
else if channel.type is 'polling'
polling.registerPollingChannel channel, (err) -> logger.error err if err

Expand Down Expand Up @@ -106,9 +106,9 @@ processPostUpdateTriggers = (channel) ->
if channel.type
if (channel.type is 'tcp' or channel.type is 'tls') and server.isTcpHttpReceiverRunning()
if authMiddleware.isChannelEnabled channel
tcpAdapter.startupTCPServer channel._id, (err) -> logger.error err if err
tcpAdapter.notifyMasterToStartTCPServer channel._id, (err) -> logger.error err if err
else
tcpAdapter.stopServerForChannel channel, (err) -> logger.error err if err
tcpAdapter.notifyMasterToStopTCPServer channel._id, (err) -> logger.error err if err

else if channel.type is 'polling'
if authMiddleware.isChannelEnabled channel
Expand Down Expand Up @@ -153,7 +153,7 @@ exports.updateChannel = (channelId) ->
processPostDeleteTriggers = (channel) ->
if channel.type
if (channel.type is 'tcp' or channel.type is 'tls') and server.isTcpHttpReceiverRunning()
tcpAdapter.stopServerForChannel channel, (err) -> logger.error err if err
tcpAdapter.notifyMasterToStopTCPServer channel._id, (err) -> logger.error err if err
else if channel.type is 'polling'
polling.removePollingChannel channel, (err) -> logger.error err if err

Expand Down
2 changes: 1 addition & 1 deletion src/api/restart.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports.restart = (next) ->

# valid certificate/key
if result
server.startRestartServerAgenda ->
server.startRestartServerTimeout ->
logger.info 'User ' +emailAddr+ ' has requested a Server Restart. Proceeding to restart servers...'

# All ok! So set the result
Expand Down
Loading