Merge branch 'patch-20190110a' into 'dev'
FIX: memory exhaustion on exceptionally large message queues & multiple... See merge request hubzilla/core!1465
This commit is contained in:
commit
f6f4e40a64
@ -12,7 +12,6 @@ class Queue {
|
|||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
|
|
||||||
if($argc > 1)
|
if($argc > 1)
|
||||||
$queue_id = $argv[1];
|
$queue_id = $argv[1];
|
||||||
else
|
else
|
||||||
@ -61,10 +60,20 @@ class Queue {
|
|||||||
// or just prior to this query based on recent and long-term delivery history. If we have good reason to believe
|
// or just prior to this query based on recent and long-term delivery history. If we have good reason to believe
|
||||||
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
|
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
|
||||||
// or twice a day.
|
// or twice a day.
|
||||||
|
|
||||||
$r = q("SELECT * FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s ",
|
$sqlrandfunc = db_getfunc('rand');
|
||||||
|
|
||||||
|
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
|
||||||
db_utcnow()
|
db_utcnow()
|
||||||
);
|
);
|
||||||
|
while ($r) {
|
||||||
|
foreach($r as $rv) {
|
||||||
|
queue_deliver($rv);
|
||||||
|
}
|
||||||
|
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
|
||||||
|
db_utcnow()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(! $r)
|
if(! $r)
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user