From 46d3cc1be2d671d9782e6f48dac48f81e46053a9 Mon Sep 17 00:00:00 2001 From: Andi Date: Wed, 22 Jan 2025 13:52:01 +0100 Subject: [PATCH] Update add-scheduled-task.md Removed non existing method supposedly prescribed by the ScheduledTaskHandler Interface. This is probably a remain of an older shopware version. --- .../plugins/plugins/plugin-fundamentals/add-scheduled-task.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-scheduled-task.md b/guides/plugins/plugins/plugin-fundamentals/add-scheduled-task.md index 8a4d53825..a08dd2f37 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-scheduled-task.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-scheduled-task.md @@ -101,9 +101,8 @@ class ExampleTaskHandler extends ScheduledTaskHandler } ``` -The respective task handler, `ExampleTaskHandler` as defined previously in your `services.xml`, has to extend from the class `Shopware\Core\Framework\MessageQueue\ScheduledTask\ScheduledTaskHandler`. This also comes with two methods, that you need to implement first: +The respective task handler, `ExampleTaskHandler` as defined previously in your `services.xml`, will be annotated with `AsMessageHandler` handeling the `ExampleTask` class. In addition the `ScheduledTaskHandler` has to extend from the class `Shopware\Core\Framework\MessageQueue\ScheduledTask\ScheduledTaskHandler`. This also comes with one method, that you need to implement first: -* `getHandledMessages`: An iterable, or an array, of the scheduled tasks, that this handler will take care of. In this case this is only the `ExampleTask` class. * `run`: This method is executed once your scheduled task is executed. Do everything, that your task is supposed to do here. In this example, it will just create a new file. Now every five minutes, your task will be executed and it will print an output every time now.