projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
94f04f6
)
Notify.php
author
Alan Knowles
<alan@roojs.com>
Thu, 20 Aug 2015 02:48:56 +0000
(10:48 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 20 Aug 2015 02:48:56 +0000
(10:48 +0800)
Notify.php
patch
|
blob
|
history
diff --git
a/Notify.php
b/Notify.php
index
1c2c5cd
..
65e7480
100644
(file)
--- a/
Notify.php
+++ b/
Notify.php
@@
-172,13
+172,14
@@
class Pman_Core_Notify extends Pman
//DB_DataObject::debugLevel(1);
$w = DB_DataObject::factory($this->table);
//DB_DataObject::debugLevel(1);
$w = DB_DataObject::factory($this->table);
+ $total = 0;
if (!empty($opts['old'])) {
// show old and new...
$w->orderBy('act_when DESC'); // latest first
$w->limit($opts['limit']); // we can run
if (!empty($opts['old'])) {
// show old and new...
$w->orderBy('act_when DESC'); // latest first
$w->limit($opts['limit']); // we can run
-
+ $total = min($w->count(), $opts['limit']);
} else {
// standard
} else {
// standard
@@
-191,7
+192,7
@@
class Pman_Core_Notify extends Pman
}
$w->orderBy('act_when ASC'); // oldest first.
}
$w->orderBy('act_when ASC'); // oldest first.
-
+ $total = min($w->count(), $opts['limit']);
$this->logecho("QUEUE is {$w->count()} only running " . ((int) $opts['limit']));
$w->limit($opts['limit']); // we can run 1000 ...
$this->logecho("QUEUE is {$w->count()} only running " . ((int) $opts['limit']));
$w->limit($opts['limit']); // we can run 1000 ...
@@
-225,6
+226,7
@@
class Pman_Core_Notify extends Pman
while (true) {
if ($w->fetch()) {
$ar[] = clone($w);
while (true) {
if ($w->fetch()) {
$ar[] = clone($w);
+ $total--;
}
$this->logecho("BATCH SIZE: ". count($ar) );
}
$this->logecho("BATCH SIZE: ". count($ar) );