mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-02-09 15:10:46 +00:00
fix: timeout issue
This commit is contained in:
3
app.js
3
app.js
@@ -51,7 +51,7 @@ srf.on('connect', (err, hp) => {
|
|||||||
// Only run when I'm the first member in the set Of Actip Sip SBC
|
// Only run when I'm the first member in the set Of Actip Sip SBC
|
||||||
const set = await retrieveSet(setName);
|
const set = await retrieveSet(setName);
|
||||||
const newArray = Array.from(set);
|
const newArray = Array.from(set);
|
||||||
let startRegBot = !newArray || newArray.length == 0;
|
let startRegBot = !newArray || newArray.length === 0;
|
||||||
if (!startRegBot) {
|
if (!startRegBot) {
|
||||||
const firstSbc = newArray.at(0);
|
const firstSbc = newArray.at(0);
|
||||||
const hostports = hp.split(',');
|
const hostports = hp.split(',');
|
||||||
@@ -67,6 +67,7 @@ srf.on('connect', (err, hp) => {
|
|||||||
srf.locals.regbotStatus = require('./lib/sip-trunk-register')(logger, srf);
|
srf.locals.regbotStatus = require('./lib/sip-trunk-register')(logger, srf);
|
||||||
} else {
|
} else {
|
||||||
// Timer 30 seconds to make sure the task is transfered to another SBC outbound handler
|
// Timer 30 seconds to make sure the task is transfered to another SBC outbound handler
|
||||||
|
// In case the first server is dead.
|
||||||
setTimeout(ativateRegBot.bind(this, err, hp), 30 * 1000);
|
setTimeout(ativateRegBot.bind(this, err, hp), 30 * 1000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ test('trunk register tests when its IP in redis cache', (t) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('trunk not register tests when its IP in redis cache', (t) => {
|
test('trunk not register tests when its IP is not in redis cache', (t) => {
|
||||||
clearModule.all();
|
clearModule.all();
|
||||||
const { srf } = require('../app');
|
const { srf } = require('../app');
|
||||||
t.timeoutAfter(60000);
|
t.timeoutAfter(60000);
|
||||||
|
|||||||
Reference in New Issue
Block a user