Fixing serverId issues

This commit is contained in:
Bruno Alves de Faria committed 2017-06-16 16:36:34 -03:00
1 parent 95533c785b
commit b4bb44625c
62 files changed
+685 -556

No files matched your search

@@ -1,11 +1,13 @@
import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
import { CurrentServer } from 'meteor/ohif:servers/both/collections';
const setupDIMSE = () => {
// Terminate existing DIMSE servers and sockets and clean up the connection object
DIMSE.connection.reset();
// Get the new server configuration
const server = getCurrentServer();
const server = OHIF.servers.getCurrentServer();
// Stop here if the new server is not of DIMSE type
if (server.type !== 'dimse') {
@@ -15,16 +17,16 @@ const setupDIMSE = () => {
// Check if peers were defined in the server configuration and throw an error if not
const peers = server.peers;
if (!peers || !peers.length) {
console.error('dimse-config: ' + 'No DIMSE Peers provided.');
OHIF.log.error('dimse-config: ' + 'No DIMSE Peers provided.');
throw new Meteor.Error('dimse-config', 'No DIMSE Peers provided.');
}
// Add all the DIMSE peers, establishing the connections
console.log('Adding DIMSE peers');
OHIF.log.info('Adding DIMSE peers');
try {
peers.forEach(peer => DIMSE.connection.addPeer(peer));
} catch(error) {
console.error('dimse-addPeers: ' + error);
OHIF.log.error('dimse-addPeers: ' + error);
throw new Meteor.Error('dimse-addPeers', error);
}
};