Fix for timeout error
This commit is contained in:
parent
1e3066cea7
commit
bf34e53d5b
@ -22,6 +22,10 @@ const sign = {
|
||||
let deviceToken = uuidv4().replaceAll('-', '').toUpperCase();
|
||||
var cookie = null;
|
||||
|
||||
setInterval(() => {
|
||||
cookie = null;
|
||||
}, 10*60*60*1000);
|
||||
|
||||
const myWs = function (options) {
|
||||
return class wsClass extends WebSocket {
|
||||
constructor(...args) {
|
||||
@ -140,7 +144,10 @@ function getToken(ctx) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(tokenRefreshUrl, {
|
||||
method: 'POST',
|
||||
headers: new Headers({ 'Content-Type': 'application/json' }),
|
||||
headers: new Headers({
|
||||
'Content-Type': 'application/json',
|
||||
'cookie': cookie
|
||||
}),
|
||||
body: JSON.stringify(ctx)
|
||||
})
|
||||
.then(res => {
|
||||
@ -184,7 +191,7 @@ function waitForReport(centrifugoConfig, channel) {
|
||||
} else {
|
||||
reject(new Error('Request to avtocod timed out'));
|
||||
}
|
||||
}, 10000);
|
||||
}, 15000);
|
||||
|
||||
const sub = centrifuge.newSubscription(channel);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user