Commit 1803db123e038244d160dd160ec448dc5ea43ef7

Authored by Adhidarma Hadiwinoto
1 parent b89aa1e369
Exists in master

module_type as variable

Showing 1 changed file with 8 additions and 2 deletions Side-by-side Diff

... ... @@ -6,15 +6,17 @@ 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 15 uri: config.core_url + '/heartbeats',
14 16 method: 'POST',
15 17 json: {
16 18 name: config.handler_name,
17   - module_type: 'gateway',
  19 + module_type: module_type,
18 20 config: config,
19 21 matrix: matrix
20 22 }
... ... @@ -28,3 +30,7 @@ setInterval(
28 30 sendHeartbeat,
29 31 60 * 1000
30 32 )
  33 +
  34 +function setModuleType(value) {
  35 + module_type = value;
  36 +}