mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-14 00:48:05 +00:00
use extended dhtget timeout parameters for mentions and hashtags (requires twister_core >= 0.9.14)
This commit is contained in:
parent
a31b36488c
commit
72782cea6c
@ -194,7 +194,8 @@ function requestHashtag(postboard,hashtag,resource) {
|
||||
dhtget( hashtag, resource, "m",
|
||||
function(args, data) {
|
||||
processHashtag(args.postboard, args.hashtag, data);
|
||||
}, {postboard:postboard,hashtag:hashtag} );
|
||||
}, {postboard:postboard,hashtag:hashtag},
|
||||
[10000,2000,3]); // use extended timeout parameters (requires twister_core >= 0.9.14)
|
||||
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ function _dhtgetAbortPending(locator)
|
||||
// get data from dht resource
|
||||
// the value ["v"] is extracted from response and returned to callback
|
||||
// null is passed to callback in case of an error
|
||||
function dhtget( username, resource, multi, cbFunc, cbArg ) {
|
||||
function dhtget( username, resource, multi, cbFunc, cbArg, timeoutArgs ) {
|
||||
var locator = _dhtgetLocator(username, resource, multi);
|
||||
if( locator in _dhtgetPendingMap) {
|
||||
_dhtgetAddPending(locator, cbFunc, cbArg);
|
||||
@ -98,7 +98,7 @@ function dhtget( username, resource, multi, cbFunc, cbArg ) {
|
||||
// limit the number of simultaneous dhtgets.
|
||||
// this should leave some sockets for other non-blocking daemon requests.
|
||||
if( _dhtgetsInProgress < _maxDhtgets ) {
|
||||
_dhtgetInternal( username, resource, multi );
|
||||
_dhtgetInternal( username, resource, multi, timeoutArgs );
|
||||
} else {
|
||||
// just queue the locator. it will be unqueue when some dhtget completes.
|
||||
_queuedDhtgets.push(locator);
|
||||
@ -106,10 +106,14 @@ function dhtget( username, resource, multi, cbFunc, cbArg ) {
|
||||
}
|
||||
}
|
||||
|
||||
function _dhtgetInternal( username, resource, multi ) {
|
||||
function _dhtgetInternal( username, resource, multi, timeoutArgs ) {
|
||||
var locator = _dhtgetLocator(username, resource, multi);
|
||||
_dhtgetsInProgress++;
|
||||
twisterRpc("dhtget", [username,resource,multi],
|
||||
argsList = [username,resource,multi];
|
||||
if( typeof timeoutArgs !== 'undefined' ) {
|
||||
argsList = argsList.concat(timeoutArgs);
|
||||
}
|
||||
twisterRpc("dhtget", argsList,
|
||||
function(args, ret) {
|
||||
_dhtgetsInProgress--;
|
||||
_dhtgetProcessPending(args.locator, args.multi, ret);
|
||||
|
@ -69,7 +69,8 @@ function requestMentionsCount() {
|
||||
}
|
||||
$.MAL.updateNewMentionsUI(_newMentions);
|
||||
}
|
||||
}, {});
|
||||
}, {},
|
||||
[10000,2000,3]); // use extended timeout parameters (requires twister_core >= 0.9.14)
|
||||
}
|
||||
|
||||
function resetMentionsCount() {
|
||||
|
Loading…
Reference in New Issue
Block a user