Skip to content

Commit

Permalink
backend:kv-delete-query-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaygupta18 authored and piyushKumar-1 committed Dec 11, 2024
1 parent 896a634 commit 0aab75d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/EulerHS/KVConnector/Flow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -637,17 +637,15 @@ updateKVAndDBResults meshCfg whereClause eitherDbRows eitherKvRows mbUpdateVals
kvDeadRows = snd allKVRows
kvLiveAndDeadRows = kvLiveRows ++ kvDeadRows
matchedKVLiveRows = findAllMatching whereClause kvLiveRows
if isRecachingEnabled && meshCfg.meshEnabled
if isRecachingEnabled && meshCfg.meshEnabled && isLive
then do
let uniqueDbRows = getUniqueDBRes meshCfg.redisKeyPrefix allDBRows kvLiveAndDeadRows
reCacheDBRowsRes <- reCacheDBRows meshCfg uniqueDbRows
case reCacheDBRowsRes of
Left err -> return $ Left $ RedisError (show err <> "Primary key => " <> show (getLookupKeyByPKey meshCfg.redisKeyPrefix <$> uniqueDbRows) <> " Secondary key => " <> show (getSecondaryLookupKeys meshCfg.redisKeyPrefix <$> uniqueDbRows) <> " in updateKVAndDBResults")
Right _ -> do
let allRows = matchedKVLiveRows ++ uniqueDbRows
sequence <$> if isLive
then mapM (updateObjectRedis meshCfg updVals setClause True whereClause) allRows
else mapM (deleteObjectRedis meshCfg True whereClause) allRows
sequence <$> mapM (updateObjectRedis meshCfg updVals setClause True whereClause) allRows
else do
updateOrDelKVRowRes <- if isLive
then mapM (updateObjectRedis meshCfg updVals setClause True whereClause) matchedKVLiveRows
Expand Down

0 comments on commit 0aab75d

Please sign in to comment.