3434
3535#include "model.h"
3636#include "redisai.h"
37+ #include "background_workers.h"
3738#include "rmutil/alloc.h"
3839#include "rmutil/args.h"
3940#include "run_info.h"
@@ -889,7 +890,7 @@ void RedisAI_Disconnected(RedisModuleCtx *ctx, RedisModuleBlockedClient *bc) {
889890 RedisModule_Log (ctx , "warning" , "Blocked client %p disconnected!" , (void * )bc );
890891}
891892
892- // Parse the DAG run command and return true if it is a valid command to execute.
893+ // Parse the DAG run command and return REDISMODULE_OK only if it is a valid command to execute.
893894static int DAG_CommandParser (RedisModuleCtx * ctx , RedisModuleString * * argv , int argc , int dagMode ,
894895 RedisAI_RunInfo * * rinfo_ptr ) {
895896
@@ -1229,7 +1230,7 @@ static int DAG_CommandParser(RedisModuleCtx *ctx, RedisModuleString **argv, int
12291230
12301231// Add Shallow copies of the DAG run info to the devices' queues.
12311232// Return REDISMODULE_OK in case of success, REDISMODULE_ERR if (at least) one insert op had failed.
1232- static bool DAG_InsertDAGToQueue (RedisAI_RunInfo * rinfo ) {
1233+ static int DAG_InsertDAGToQueue (RedisAI_RunInfo * rinfo ) {
12331234 const char * * devices = array_new (const char * , 10 );
12341235
12351236 for (long long i = 0 ; i < array_len (rinfo -> dagOps ); i ++ ) {
@@ -1280,7 +1281,7 @@ static bool DAG_InsertDAGToQueue(RedisAI_RunInfo *rinfo) {
12801281 array_free (rinfo_copies );
12811282 array_free (run_queues_info );
12821283 RAI_SetError (rinfo -> err , RAI_EDAGRUN , "ERR Queue not initialized for device" );
1283- rinfo -> OnFinish ((RedisAI_OnFinishCtx )rinfo , rinfo -> private_data );
1284+ rinfo -> OnFinish ((RedisAI_OnFinishCtx * )rinfo , rinfo -> private_data );
12841285 return REDISMODULE_ERR ;
12851286 }
12861287 run_queues_info = array_append (run_queues_info , run_queue_info );
@@ -1302,7 +1303,7 @@ static bool DAG_InsertDAGToQueue(RedisAI_RunInfo *rinfo) {
13021303 return REDISMODULE_OK ;
13031304}
13041305
1305- void DAG_ReplyAndUnblock (RedisAI_OnFinishCtx ctx , void * private_data ) {
1306+ void DAG_ReplyAndUnblock (RedisAI_OnFinishCtx * ctx , void * private_data ) {
13061307
13071308 RedisAI_RunInfo * rinfo = (RedisAI_RunInfo * )ctx ;
13081309 if (rinfo -> client )
0 commit comments