getLabelCounters: skip processing when labels are disabled; misc performance tweaks

This commit is contained in:
Andrew Dolgov 2009-01-17 19:42:02 +01:00
parent 34c30ac126
commit abd9b16507
2 changed files with 38 additions and 36 deletions

View file

@ -358,7 +358,7 @@
// } // }
if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop || if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop ||
time() - $_SESSION["viewfeed:counters_stamp"] > 30) { time() - $_SESSION["viewfeed:counters_stamp"] > 60) {
if (!$offset) { if (!$offset) {
print "<counters>"; print "<counters>";
getAllCounters($link, $omode, $feed); getAllCounters($link, $omode, $feed);

View file

@ -2678,6 +2678,7 @@
$ret_arr["-3"]["description"] = __("Fresh articles"); $ret_arr["-3"]["description"] = __("Fresh articles");
} }
if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) {
$result = db_query($link, "SELECT owner_uid,id,sql_exp,description FROM $result = db_query($link, "SELECT owner_uid,id,sql_exp,description FROM
ttrss_labels WHERE owner_uid = ".$_SESSION["uid"]." ORDER by description"); ttrss_labels WHERE owner_uid = ".$_SESSION["uid"]." ORDER by description");
@ -2720,6 +2721,7 @@
error_reporting (DEFAULT_ERROR_LEVEL); error_reporting (DEFAULT_ERROR_LEVEL);
} }
}
if ($smart_mode && $lctrs_modified) { if ($smart_mode && $lctrs_modified) {
$_SESSION["lctr_last_value"] = $old_counters; $_SESSION["lctr_last_value"] = $old_counters;