我正在尝试调试代码的某些部分,但 /longpolling/poll 调用限制我这样做。知道如何禁用它吗?
问问题
66 次
1 回答
0
它开始工作了...我的意思是通过注释掉以下代码片段来停止 longpolling/poll 调用... Longpolling_bus.js /// 第 173 行
`_poll: function () {
// var self = this;
// if (!this._isActive) {
// return;
// }
// var now = new Date().getTime();
// var options = _.extend({}, this._options, {
// bus_inactivity: now - this._getLastPresence(),
// });
// if (this._lastPartnersPresenceCheck + this.PARTNERS_PRESENCE_CHECK_PERIOD > now) {
// options = _.omit(options, 'bus_presence_partner_ids');
// } else {
// this._lastPartnersPresenceCheck = now;
// }
// var data = {channels: this._channels, last: this._lastNotificationID, options: options};
// // The backend has a maximum cycle time of 50 seconds so give +10 seconds
// this._pollRpc = this._rpc({route: this.POLL_ROUTE, params: data}, {shadow : true, timeout: 60000});
// this._pollRpc.then(function (result) {
// self._pollRpc = false;
// self._onPoll(result);
// self._poll();
// }, function (error, ev) {
// self._pollRpc = false;
// // no error popup if request is interrupted or fails for any reason
// ev.preventDefault();
// if (error && error.message === "XmlHttpRequestError abort") {
// self._poll();
// } else {
// // random delay to avoid massive longpolling
// self._pollRetryTimeout = setTimeout(self._poll, self.ERROR_RETRY_DELAY + (Math.floor((Math.random()*20)+1)*1000));
// }
// });
}
`
于 2019-03-06T06:02:53.453 回答