Compare View

switch
from
...
to
 
Commits (5)

Changes

Showing 3 changed files Side-by-side Diff

... ... @@ -8,6 +8,8 @@ const matrix = require('../matrix');
8 8 const controlPanel = require('../control-panel');
9 9 const heartbeat = require('../heartbeat');
10 10  
  11 +heartbeat.setModuleType('gateway');
  12 +
11 13 var partner;
12 14  
13 15 function setPartner(_partner) {
... ... @@ -6,16 +6,19 @@ const config = require('./config');
6 6 const logger = require('./logger');
7 7 const matrix = require('./matrix');
8 8  
  9 +let module_type;
  10 +
9 11 function sendHeartbeat() {
10   - if (!config || !config.core_url) { return; }
  12 + if (!config || !config.core_url || !module_type) { return; }
11 13  
12 14 const requestOptions = {
13   - url: config.core_url + '/heartbeats',
14   - form: {
  15 + uri: config.core_url + '/heartbeats',
  16 + method: 'POST',
  17 + json: {
15 18 name: config.handler_name,
16   - module_type: 'gateway',
17   - config: JSON.stringify(config),
18   - matrix: JSON.stringify(matrix)
  19 + module_type: module_type,
  20 + config: config,
  21 + matrix: matrix
19 22 }
20 23 }
21 24  
... ... @@ -27,3 +30,9 @@ setInterval(
27 30 sendHeartbeat,
28 31 60 * 1000
29 32 )
  33 +
  34 +function setModuleType(value) {
  35 + module_type = value;
  36 +}
  37 +
  38 +exports.setModuleType = setModuleType;
1 1 {
2 2 "name": "komodo-sdk",
3   - "version": "1.12.0",
  3 + "version": "1.12.1",
4 4 "description": "SDK for Komodo",
5 5 "main": "index.js",
6 6 "scripts": {