some logging for queues

darcs-hash:20080704055259-84dde-1bc6947531632f0d9d93277f6138cc81c82196af.gz
This commit is contained in:
Evan Prodromou 2008-07-04 01:52:59 -04:00
parent d0897f4d1f
commit 94a7924767
1 changed files with 4 additions and 0 deletions

View File

@ -52,11 +52,15 @@ function qd_top_item() {
# XXX: potential race condition
# can we force it to only update if claimed is still NULL
# (or old)?
qd_log(LOG_INFO, 'claiming queue item = ' . $queue->notice_id);
$orig = clone($qi);
$qi->claimed = DB_DataObject_Cast::dateTime();
$result = $qi->update($orig);
if ($result) {
qd_log(LOG_INFO, 'claim succeeded.');
return $qi;
} else {
qd_log(LOG_INFO, 'claim failed.');
}
}
$qi = NULL;