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