From 48fd76f1dbe17df65fa072295d5c2d6e76a22c2c Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 16 Sep 2023 23:11:53 +0300 Subject: [PATCH] fix push api request queue --- src/crontab/export/push.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crontab/export/push.php b/src/crontab/export/push.php index 7e6de19..18ae4e2 100644 --- a/src/crontab/export/push.php +++ b/src/crontab/export/push.php @@ -40,12 +40,12 @@ $public = [ // Push export enabled if (API_EXPORT_PUSH_ENABLED) { - // Init request - $request = []; - // Get push queue from memory pool foreach((array) $memoryApiExportPush = $memory->get('api.export.push') as $id => $push) { + // Init request + $request = []; + // User request if (!empty($push->userId) && API_EXPORT_USERS_ENABLED) { @@ -432,7 +432,7 @@ if (API_EXPORT_PUSH_ENABLED) // @TODO add recipient manifest conditions check to not disturb it API without needs // Send push request - $debug['dump'][$manifest->import->push]['request'] = $request; + $debug['dump'][$manifest->import->push]['request'][] = $request; $curl = new Curl( $manifest->import->push, @@ -461,11 +461,11 @@ if (API_EXPORT_PUSH_ENABLED) continue; } - $debug['dump'][$manifest->import->push]['response'] = $response; + $debug['dump'][$manifest->import->push]['response'][] = $response; } // Drop processed item from queue - //unset($memoryApiExportPush[$id]); + unset($memoryApiExportPush[$id]); } // Update memory pool