Prevent timeout when restoring drive
This commit is contained in:
@@ -32,12 +32,14 @@ define([
|
||||
var chan = {};
|
||||
|
||||
// Send a query. channel.query('Q_SOMETHING', { args: "whatever" }, function (reply) { ... });
|
||||
chan.query = function (q, content, cb) {
|
||||
chan.query = function (q, content, cb, opts) {
|
||||
var txid = mkTxid();
|
||||
opts = opts || {};
|
||||
var to = opts.timeout || 30000;
|
||||
var timeout = setTimeout(function () {
|
||||
delete queries[txid];
|
||||
//console.log("Timeout making query " + q);
|
||||
}, 30000);
|
||||
}, to);
|
||||
queries[txid] = function (data, msg) {
|
||||
clearTimeout(timeout);
|
||||
delete queries[txid];
|
||||
|
||||
Reference in New Issue
Block a user