From 3390941ac669daf2459ac80bd236ee49d7e7aa0b Mon Sep 17 00:00:00 2001 From: Thierno Diallo Date: Mon, 14 Nov 2022 18:04:39 -0500 Subject: [PATCH] Programming Challenge #6 optimization --- .../com/redislabs/university/RU102J/dao/FeedDaoRedisImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/redislabs/university/RU102J/dao/FeedDaoRedisImpl.java b/src/main/java/com/redislabs/university/RU102J/dao/FeedDaoRedisImpl.java index c125f66..ca1de39 100644 --- a/src/main/java/com/redislabs/university/RU102J/dao/FeedDaoRedisImpl.java +++ b/src/main/java/com/redislabs/university/RU102J/dao/FeedDaoRedisImpl.java @@ -28,8 +28,8 @@ public void insert( MeterReading meterReading ) { try ( Jedis jedis = jedisPool.getResource() ) { Pipeline pipeline = jedis.pipelined(); - pipeline.xadd( RedisSchema.getGlobalFeedKey(), StreamEntryID.NEW_ENTRY, meterReading.toMap() ); - pipeline.xadd( RedisSchema.getFeedKey( meterReading.getSiteId() ), StreamEntryID.NEW_ENTRY, meterReading.toMap() ); + pipeline.xadd( RedisSchema.getGlobalFeedKey(), StreamEntryID.NEW_ENTRY, meterReading.toMap(), globalMaxFeedLength, true ); + pipeline.xadd( RedisSchema.getFeedKey( meterReading.getSiteId() ), StreamEntryID.NEW_ENTRY, meterReading.toMap(), siteMaxFeedLength, true ); pipeline.sync(); }