Skip to content

Commit

Permalink
Programming Challenge redislabs-training#6 optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiernoAmirouDiallo committed Nov 14, 2022
1 parent 51f4719 commit 3390941
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 3390941

Please sign in to comment.