more...
This commit is contained in:
@ -5,9 +5,19 @@ const {Torrent} = require('>/models');
|
||||
|
||||
console.log('here!!!!!!!!!!!!!')
|
||||
|
||||
let statusLock = false;
|
||||
setInterval(async function(){
|
||||
ps.publish('torrent:server:status', await Torrent.trClient.sessionStats())
|
||||
}, 3000);
|
||||
if(statusLock) return;
|
||||
statusLock = true;
|
||||
try{
|
||||
ps.publish('torrent:server:status', await Torrent.trClient.sessionStats());
|
||||
}catch(error){
|
||||
ps.publish('torrent:server:status:down')
|
||||
// if(error.code === 'ECONNREFUSED') throw new Error('TorrentGatewayDown');
|
||||
// console.error('status interval error', error)
|
||||
}
|
||||
statusLock = false
|
||||
}, 10000, statusLock);
|
||||
|
||||
|
||||
// ps.subscribe(/./g, function(...args){
|
||||
|
Reference in New Issue
Block a user