Skip to content

Commit

Permalink
Add trying status in progress report
Browse files Browse the repository at this point in the history
  • Loading branch information
aimakun committed Mar 22, 2010
1 parent 8c603b6 commit c388fff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions classes/BulkLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ function fetch() {

function countQueue($status = 'queue') {
switch ($status) {
case 'queue_try':
$cond = "WHERE status='queue' AND tries > 0";
break;
case 'manual':
case 'queue':
case 'publish':
Expand Down
2 changes: 1 addition & 1 deletion cron/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$s = file_get_contents(dirname(__FILE__) . "/cronrun.txt");
if (!eregi('ON', $s)) die($s); // Cron switch on/off.

$main_path = 'http://localhost/git_branches/lookup_stable/hotri';
$main_path = 'http://localhost/git_branches/odlib_lookup/hotri';
$s = file_get_contents($main_path . '/cron/lookup.php');


2 changes: 1 addition & 1 deletion cron/lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require_once(dirname(__FILE__) . "/../shared/common.php");
require_once(dirname(__FILE__) . '/../classes/BulkLookup.php');
// Process ISBN lookup
$limit = 100;
$limit = 30;
$q = new BulkLookupQuery();
$remain = $q->countQueue();

Expand Down
3 changes: 2 additions & 1 deletion lookup2/BulkStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require_once('../classes/BulkLookup.php');
$q = new BulkLookupQuery();
$queued = $q->countQueue();
$trying = $q->countQueue('queue_try');
$done = $q->countQueue('publish');
$covered = $q->countQueue('cover');
$copied = $q->countQueue('copy');
Expand All @@ -18,7 +19,7 @@
if ($queued < 1) {
echo "DONE";
}
echo "Last updated: " . date('Y-m-d H:i:s') . "<br />Remaining: $queued, done: " . ($done + $covered) . " ($covered covered), copied: $copied, failed: $failed";
echo "Last updated: " . date('Y-m-d H:i:s') . "<br />Remaining: $queued ($trying trying), done: " . ($done + $covered) . " ($covered covered), copied: $copied, failed: $failed";
if ($queued < 1) {
echo '<h5 id="updateMsg">All items has been proceed!</h5> <br /><a href="BulkLookup.php">continue import</a> | <a href="../reports/bulk_report.php">view failed items</a><br /><br />';
/*
Expand Down

0 comments on commit c388fff

Please sign in to comment.