Skip to content

Commit 203d1c8

Browse files
committed
fixed issue with streamwriter
1 parent 689cdff commit 203d1c8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.redislabs</groupId>
1414
<artifactId>riot</artifactId>
15-
<version>0.3.0</version>
15+
<version>0.4.1</version>
1616
<packaging>jar</packaging>
1717
<name>RIOT</name>
1818
<description>Redis Input/Output Tool</description>

src/main/java/com/redislabs/riot/redis/writer/StreamWriter.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ protected void write(Pipeline pipeline, String key, Map<String, Object> item) {
2626
if (idField == null) {
2727
if (maxlen == null) {
2828
pipeline.xadd(key, new StreamEntryID(), fields);
29+
} else {
30+
pipeline.xadd(key, new StreamEntryID(), fields, maxlen, approximateTrimming);
31+
}
32+
} else {
33+
String id = id(item);
34+
if (maxlen == null) {
35+
pipeline.xadd(key, new StreamEntryID(id), fields);
36+
} else {
37+
pipeline.xadd(key, new StreamEntryID(id), fields, maxlen, approximateTrimming);
2938
}
30-
pipeline.xadd(key, new StreamEntryID(), fields, maxlen, approximateTrimming);
31-
}
32-
String id = id(item);
33-
if (maxlen == null) {
34-
pipeline.xadd(key, new StreamEntryID(id), fields);
3539
}
36-
pipeline.xadd(key, new StreamEntryID(id), fields, maxlen, approximateTrimming);
3740
}
3841

3942
@Override

0 commit comments

Comments
 (0)