return;
}
- if ($subop == "getAllCounters") {
- print "<rpc-reply>";
- print "<counters><![CDATA[";
-
- print json_encode(getAllCounters($link, $_REQUEST['omode']));
-
- print "]]></counters>";
- print_runtime_info($link);
- print "</rpc-reply>";
-
- return;
- }
-
if ($subop == "mark") {
$mark = $_REQUEST["mark"];
$id = db_escape_string($_REQUEST["id"]);
return;
}
- if ($subop == "updateAllFeeds") {
+ if ($subop == "updateAllFeeds" || $subop == "getAllCounters") {
$global_unread_caller = sprintf("%d", $_REQUEST["uctr"]);
$global_unread = getGlobalUnread($link);
function scheduleFeedUpdate() {
- console.log("in scheduleFeedUpdate");
+ window.clearTimeout(counter_timeout_id);
- var query_str = "backend.php?op=rpc&subop=updateAllFeeds";
+ var query_str = "backend.php?op=rpc&subop=getAllCounters";
var omode;
query_str = query_str + "&omode=" + omode;
query_str = query_str + "&uctr=" + global_unread;
- console.log("REFETCH query: " + query_str);
+ console.log("[scheduleFeedUpdate] " + query_str);
new Ajax.Request("backend.php", {
parameters: query_str,