Skip to content

Commit 33c2b59

Browse files
authored
After merging a fix to RLTest - this is for covering aof rewrite in tests + fixing minor bug in model store (#800)
1 parent 98bdb21 commit 33c2b59

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/redisai.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,23 +208,23 @@ int RedisAI_ModelStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **arg
208208

209209
unsigned long long minbatchsize = 0;
210210
if (AC_AdvanceIfMatch(&ac, "MINBATCHSIZE")) {
211-
if (batchsize == 0) {
212-
return RedisModule_ReplyWithError(ctx, "ERR MINBATCHSIZE specified without BATCHSIZE");
213-
}
214211
if (AC_GetUnsignedLongLong(&ac, &minbatchsize, 0) != AC_OK) {
215212
return RedisModule_ReplyWithError(ctx, "ERR Invalid argument for MINBATCHSIZE");
216213
}
214+
if (batchsize == 0 && minbatchsize > 0) {
215+
return RedisModule_ReplyWithError(ctx, "ERR MINBATCHSIZE specified without BATCHSIZE");
216+
}
217217
}
218218

219219
unsigned long long minbatchtimeout = 0;
220220
if (AC_AdvanceIfMatch(&ac, "MINBATCHTIMEOUT")) {
221-
if (minbatchsize == 0) {
222-
return RedisModule_ReplyWithError(ctx,
223-
"ERR MINBATCHTIMEOUT specified without MINBATCHSIZE");
224-
}
225221
if (AC_GetUnsignedLongLong(&ac, &minbatchtimeout, 0) != AC_OK) {
226222
return RedisModule_ReplyWithError(ctx, "ERR Invalid argument for MINBATCHTIMEOUT");
227223
}
224+
if (minbatchsize == 0 && minbatchtimeout > 0) {
225+
return RedisModule_ReplyWithError(ctx,
226+
"ERR MINBATCHTIMEOUT specified without MINBATCHSIZE");
227+
}
228228
}
229229
RAI_ModelOpts opts = {
230230
.batchsize = batchsize,

tests/flow/test_serializations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_v3_tensor(self):
276276
class TestAofRewrite:
277277

278278
def __init__(self):
279-
self.env = Env(useAof=True)
279+
self.env = Env(useAof=True, useRdbPreamble=False)
280280

281281
def test_aof_rewrite_tf_model(self):
282282
key_name = "tf_graph{1}"

0 commit comments

Comments
 (0)