projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e6202d7
)
reduce number of update queries
author
Alan
<alan@roojs.com>
Thu, 10 Aug 2023 10:22:29 +0000
(18:22 +0800)
committer
Alan
<alan@roojs.com>
Thu, 10 Aug 2023 10:22:29 +0000
(18:22 +0800)
Notify.php
patch
|
blob
|
history
diff --git
a/Notify.php
b/Notify.php
index
cff037a
..
684b4ea
100644
(file)
--- a/
Notify.php
+++ b/
Notify.php
@@
-379,6
+379,20
@@
class Pman_Core_Notify extends Pman
$num_servers = count(array_keys($ff->Core_Notify['servers']));
$p = DB_DataObject::factory($this->table);
$num_servers = count(array_keys($ff->Core_Notify['servers']));
$p = DB_DataObject::factory($this->table);
+ $p->whereAdd("
+ sent < '2000-01-01'
+ and
+ event_id = 0
+ and
+ act_start < NOW() + INTERVAL 3 HOUR
+ and
+ server_id < 0"
+
+ );
+ if ($p->count() < 1) {
+ return;
+ }
+
// 6 seconds on this machne...
$p->query("
UPDATE
// 6 seconds on this machne...
$p->query("
UPDATE
@@
-390,13
+404,13
@@
class Pman_Core_Notify extends Pman
and
event_id = 0
and
and
event_id = 0
and
- act_start < NOW()
+ act_start < NOW()
+ INTERVAL 3 HOUR
and
server_id < 0
ORDER BY
id ASC
LIMIT
and
server_id < 0
ORDER BY
id ASC
LIMIT
-
2
0000
+
1
0000
");
");