From 0059a60f5bf6247678565c6dc30c89ede36e7556 Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Mon, 28 Apr 2025 13:22:19 +0300 Subject: [PATCH] [#2362] Set cache manager TTL by default 10sec (#2378) Signed-off-by: Avgustin Marinov --- .../eclipse/hawkbit/autoconfigure/cache/CacheProperties.java | 2 +- .../src/main/resources/application.properties | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheProperties.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheProperties.java index 0166a4fd3..9c6286e59 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheProperties.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheProperties.java @@ -25,7 +25,7 @@ public class CacheProperties { /** * TTL for cached entries in millis. */ - private int ttl; + private int ttl = 10_000; // default TTL - 10 seconds /** * Initial delay in millis diff --git a/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties b/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties index 765523ed6..bd714bc6a 100644 --- a/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties +++ b/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties @@ -37,6 +37,11 @@ server.servlet.encoding.force=true hawkbit.server.ddi.security.authentication.targettoken.enabled=false hawkbit.server.ddi.security.authentication.gatewaytoken.enabled=false +# Cache configuration, +# disable expiration since monolith is expected to be used as an all-in-one hawkBit instance, +# i.e. no microservices and 1 replica, then evict should do work +hawkbit.cache.global.ttl=0 + # Optional events hawkbit.server.repository.publish-target-poll-event=false