From 08ae408bdfdc18fb95dfef13228b32c3bacdb55b Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 25 May 2025 15:03:27 +0300 Subject: [PATCH] tasks update --- app/Controllers/Exec/Tasks/BlurNewImage.php | 43 +++++++++++++++++++ .../Exec/Tasks/ngallery-tasks.yaml | 8 +++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 app/Controllers/Exec/Tasks/BlurNewImage.php diff --git a/app/Controllers/Exec/Tasks/BlurNewImage.php b/app/Controllers/Exec/Tasks/BlurNewImage.php new file mode 100644 index 0000000..b2deac2 --- /dev/null +++ b/app/Controllers/Exec/Tasks/BlurNewImage.php @@ -0,0 +1,43 @@ + $item['id'], + 'photourl_small' => Image::generateBlurredPlaceholder($item['photourl']), + 'photourl' => $item['photourl'], + 'lat' => (float)$content['lat'], + 'lng' => (float)$content['lng'] + ]; + + } catch (\Throwable $e) { + error_log("Error processing item {$item['id']}: " . $e->getMessage()); + } + } + + echo json_encode($result); + +} catch (\Throwable $e) { + error_log("Critical error in BlurNewImage: " . $e->getMessage()); + echo json_encode([]); + exit(1); +} \ No newline at end of file diff --git a/app/Controllers/Exec/Tasks/ngallery-tasks.yaml b/app/Controllers/Exec/Tasks/ngallery-tasks.yaml index 9826714..785c9ab 100644 --- a/app/Controllers/Exec/Tasks/ngallery-tasks.yaml +++ b/app/Controllers/Exec/Tasks/ngallery-tasks.yaml @@ -1,4 +1,10 @@ tasks: - id: "ExecContests" type: "cron" - handler: "/app/Controllers/Exec/Tasks/ExecContests.php" \ No newline at end of file + handler: "/app/Controllers/Exec/Tasks/ExecContests.php" + - id: "BlurNewImage" + type: "worker" + handler: "/app/Controllers/Exec/Tasks/BlurNewImage.php" + - id: "CompressImage" + type: "worker" + handler: "/app/Controllers/Exec/Tasks/CompressImage.php" \ No newline at end of file