summaryrefslogtreecommitdiff
path: root/modules/update/update.compare.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-13 02:14:05 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-13 02:14:05 +0000
commit9058a8984d76ae238bdc3a45a1c41dfa9012445c (patch)
treea9dfd57d0dc97b22f4199eda99dc196ba6ba458d /modules/update/update.compare.inc
parentcad226e60bc5827050789d4900f1a17907c203d3 (diff)
downloadbrdo-9058a8984d76ae238bdc3a45a1c41dfa9012445c.tar.gz
brdo-9058a8984d76ae238bdc3a45a1c41dfa9012445c.tar.bz2
- Patch #597484 by dww: use the Queue API to fetch available update data.
Diffstat (limited to 'modules/update/update.compare.inc')
-rw-r--r--modules/update/update.compare.inc13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc
index db216d7cf..389c30d76 100644
--- a/modules/update/update.compare.inc
+++ b/modules/update/update.compare.inc
@@ -406,7 +406,7 @@ function update_calculate_project_data($available) {
break;
case 'not-fetched':
$projects[$project]['status'] = UPDATE_NOT_FETCHED;
- $projects[$project]['reason'] = t('Failed to fetch available update data');
+ $projects[$project]['reason'] = t('Failed to get available update data.');
break;
default:
@@ -469,6 +469,17 @@ function update_calculate_project_data($available) {
$version_patch_changed = '';
$patch = '';
+ // If the project is marked as UPDATE_FETCH_PENDING, it means that the
+ // data we currently have (if any) is stale, and we've got a task queued
+ // up to (re)fetch the data. In that case, we mark it as such, merge in
+ // whatever data we have (e.g. project title and link), and move on.
+ if (!empty($available[$project]['fetch_status']) && $available[$project]['fetch_status'] == UPDATE_FETCH_PENDING) {
+ $projects[$project]['status'] = UPDATE_FETCH_PENDING;
+ $projects[$project]['reason'] = t('No available update data');
+ $projects[$project] += $available[$project];
+ continue;
+ }
+
// Defend ourselves from XML history files that contain no releases.
if (empty($available[$project]['releases'])) {
$projects[$project]['status'] = UPDATE_UNKNOWN;