diff options
author | Mario <mario@mariovavti.com> | 2023-04-21 07:45:32 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-04-21 07:45:32 +0000 |
commit | f277d08244986c080d48af3e8bc86a9886d098bc (patch) | |
tree | 4773398a9d9e103f00301889f33711a70bb33e81 /Zotlabs/Lib | |
parent | d7c479fa6d8e9297a23017c60788c918208cfd9d (diff) | |
download | volse-hubzilla-f277d08244986c080d48af3e8bc86a9886d098bc.tar.gz volse-hubzilla-f277d08244986c080d48af3e8bc86a9886d098bc.tar.bz2 volse-hubzilla-f277d08244986c080d48af3e8bc86a9886d098bc.zip |
queue and poller testing
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/Queue.php | 24 |
2 files changed, 6 insertions, 20 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index 84117abb0..0d383c697 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -141,7 +141,7 @@ class Libsync { $total = count($synchubs); foreach ($synchubs as $hub) { - $hash = random_string(); + $hash = new_uuid(); $n = Libzot::build_packet($channel, 'sync', $env_recips, json_encode($info), 'hz', $hub['hubloc_sitekey'], $hub['site_crypto']); Queue::insert([ 'hash' => $hash, diff --git a/Zotlabs/Lib/Queue.php b/Zotlabs/Lib/Queue.php index 348a2a079..942a633ef 100644 --- a/Zotlabs/Lib/Queue.php +++ b/Zotlabs/Lib/Queue.php @@ -57,7 +57,6 @@ class Queue { outq_priority = outq_priority + %d, outq_scheduled = '%s' WHERE outq_hash = '%s'", - dbesc(datetime_convert()), intval($add_priority), dbesc($next), @@ -85,29 +84,16 @@ class Queue { // entries still exist for it. This fixes an issue where one immediate delivery left everything // else for that site undeliverable since all the other entries had been pushed far into the future. - $x = null; - $sql_quirks = ((get_config('system', 'db_skip_locked_supported')) ? 'SKIP LOCKED' : 'NOWAIT'); - - q("START TRANSACTION"); - - $r = q("SELECT outq_hash FROM outq WHERE outq_posturl = '%s' LIMIT 1 FOR UPDATE $sql_quirks", + $r = q("SELECT outq_hash, outq_posturl FROM outq WHERE outq_posturl = '%s' LIMIT 1", dbesc($record[0]['outq_posturl']) ); if ($r) { - $x = q("UPDATE outq SET outq_scheduled = '%s' WHERE outq_hash = '%s'", - dbesc(datetime_convert()), - dbesc($r[0]['outq_hash']) + $hashes = ids_to_querystr($r, 'outq_hash', true); + $x = q("UPDATE outq SET outq_scheduled = '%s' WHERE outq_hash IN ($hashes)", + dbesc(datetime_convert()) ); } - - if ($x) { - q("COMMIT"); - } - else { - q("ROLLBACK"); - } - } } @@ -260,7 +246,7 @@ class Queue { if($result['success']) { logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']); - Libzot::process_response($outq['outq_posturl'],$result, $outq); + Libzot::process_response($outq['outq_posturl'], $result, $outq); } else { logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']); |