From 0a81b00342574d1ea562f1b1aa5c3ecb39841329 Mon Sep 17 00:00:00 2001 From: Anatoly Karlov Date: Thu, 17 Aug 2023 18:32:51 +0300 Subject: [PATCH] add limit_scope_type_all Tag --- .../dev/vality/exporter/limits/service/LimitsService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/vality/exporter/limits/service/LimitsService.java b/src/main/java/dev/vality/exporter/limits/service/LimitsService.java index 4b5af8b..66b611a 100644 --- a/src/main/java/dev/vality/exporter/limits/service/LimitsService.java +++ b/src/main/java/dev/vality/exporter/limits/service/LimitsService.java @@ -109,11 +109,15 @@ public class LimitsService { @SneakyThrows private List getLimitScopeTypeTags(String limitScopeTypesJson) { - return objectMapper.readValue(limitScopeTypesJson, new TypeReference>>() { + var tags = objectMapper.readValue(limitScopeTypesJson, new TypeReference>>() { }) .stream() .flatMap(stringObjectMap -> stringObjectMap.keySet().stream()) .map(s -> Tag.of(String.format("limit_scope_type_%s", s), "true")) .collect(Collectors.toList()); + if (tags.isEmpty()) { + tags.add(Tag.of(String.format("limit_scope_type_%s", "all"), "true")); + } + return tags; } }