aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorDM42.Net (Matt Dent) <dentm42@dm42.net>2019-01-11 07:35:12 -0500
committerDM42.Net (Matt Dent) <dentm42@dm42.net>2019-01-11 07:35:12 -0500
commitcaf2c0a6c43f3162fc8f4d758eb06cb2f56b3865 (patch)
treedb11e106735561193f3cb9ebb83f44c9822dc2f2 /Zotlabs
parent6791b05a4032a076651f7c8e4790614f0f405a55 (diff)
downloadvolse-hubzilla-caf2c0a6c43f3162fc8f4d758eb06cb2f56b3865.tar.gz
volse-hubzilla-caf2c0a6c43f3162fc8f4d758eb06cb2f56b3865.tar.bz2
volse-hubzilla-caf2c0a6c43f3162fc8f4d758eb06cb2f56b3865.zip
Use dba_driver.php::db_getfunc()
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Queue.php12
1 files changed, 2 insertions, 10 deletions
diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php
index 6b525b8c3..814148404 100644
--- a/Zotlabs/Daemon/Queue.php
+++ b/Zotlabs/Daemon/Queue.php
@@ -12,16 +12,6 @@ class Queue {
require_once('include/items.php');
require_once('include/bbcode.php');
- switch (DBTYPE_ACTIVE) {
- case DBTYPE_MYSQL:
- $sqlrandfunc = "RAND()";
- break;
-
- case DBTYPE_POSTGRESQL:
- $sqlrandfunc = "RANDOM()";
- break;
- }
-
if($argc > 1)
$queue_id = $argv[1];
else
@@ -71,6 +61,8 @@ class Queue {
// 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.
+ $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()
);