Showing
2 changed files
with
7 additions
and
0 deletions
... | ... | @@ -50,10 +50,12 @@ import java.util.Map; |
50 | 50 | public class TbMsgTimeseriesNode implements TbNode { |
51 | 51 | |
52 | 52 | private TbMsgTimeseriesNodeConfiguration config; |
53 | + private long tenantProfileDefaultStorageTtl; | |
53 | 54 | |
54 | 55 | @Override |
55 | 56 | public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException { |
56 | 57 | this.config = TbNodeUtils.convert(configuration, TbMsgTimeseriesNodeConfiguration.class); |
58 | + | |
57 | 59 | } |
58 | 60 | |
59 | 61 | @Override |
... | ... | @@ -77,6 +79,9 @@ public class TbMsgTimeseriesNode implements TbNode { |
77 | 79 | } |
78 | 80 | String ttlValue = msg.getMetaData().getValue("TTL"); |
79 | 81 | long ttl = !StringUtils.isEmpty(ttlValue) ? Long.parseLong(ttlValue) : config.getDefaultTTL(); |
82 | + if (ttl == 0L) { | |
83 | + ttl = tenantProfileDefaultStorageTtl; | |
84 | + } | |
80 | 85 | ctx.getTelemetryService().saveAndNotify(ctx.getTenantId(), msg.getOriginator(), tsKvEntryList, ttl, new TelemetryNodeCallback(ctx, msg)); |
81 | 86 | } |
82 | 87 | ... | ... |