From 1c0433dc76cbbc3545a7abca64799961b0379cc9 Mon Sep 17 00:00:00 2001 From: Thomas Kurz Date: Tue, 30 Jan 2024 09:50:59 +0100 Subject: [PATCH] set interval to 1 hour for realtime trigger --- .../component/action/PushNotificationAction.java | 5 +++++ .../component/trigger/relative/RelativeTimeTrigger.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/action/PushNotificationAction.java b/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/action/PushNotificationAction.java index ca2eb2c5..da2046fe 100644 --- a/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/action/PushNotificationAction.java +++ b/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/action/PushNotificationAction.java @@ -13,15 +13,20 @@ import io.redlink.more.studymanager.core.io.ActionParameter; import io.redlink.more.studymanager.core.properties.ActionProperties; import io.redlink.more.studymanager.core.sdk.MoreActionSDK; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PushNotificationAction extends Action { + private static final Logger LOGGER = LoggerFactory.getLogger(PushNotificationAction.class); + protected PushNotificationAction(MoreActionSDK sdk, ActionProperties properties) throws ConfigurationValidationException { super(sdk, properties); } @Override public void execute(ActionParameter parameters) { + LOGGER.info("send push notification with parameters: {}", parameters.toString()); sdk.sendPushNotification( properties.getString("title"), properties.getString("message") diff --git a/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/trigger/relative/RelativeTimeTrigger.java b/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/trigger/relative/RelativeTimeTrigger.java index 9c02d683..3a306f93 100644 --- a/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/trigger/relative/RelativeTimeTrigger.java +++ b/studymanager-intervention/src/main/java/io/redlink/more/studymanager/component/trigger/relative/RelativeTimeTrigger.java @@ -32,7 +32,7 @@ protected RelativeTimeTrigger(MoreTriggerSDK sdk, TriggerProperties properties) } @Override public void activate() { - String schedule = sdk.addSchedule(new CronSchedule("1 * * * * ?")); + String schedule = sdk.addSchedule(new CronSchedule("1 0 * * * ?")); sdk.setValue("scheduleId", schedule); }