Skip to content

Commit

Permalink
Implement evalString (test is green now)
Browse files Browse the repository at this point in the history
  • Loading branch information
omnibs committed May 22, 2024
1 parent bf28b5a commit 346d758
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nri-redis/src/Redis/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ tokensToScript tokens =

-- | EVAL script numkeys [key [key ...]] [arg [arg ...]]
evalString :: Script a -> Text
evalString = Debug.todo "evalString"
evalString script' =
let paramCount = script' |> params |> Log.unSecret |> List.length |> Text.fromInt
paramKeys = paramNames script' |> Text.join " "
paramArgs = paramValues script' |> List.map (\_ -> "***") |> Text.join " "
in "EVAL " ++ luaScript script' ++ " " ++ paramCount ++ " " ++ paramKeys ++ " " ++ paramArgs

-- | Map the keys in the script to the keys in the Redis API
mapKeys :: (Text -> Task err Text) -> Script a -> Task err (Script a)
Expand Down

0 comments on commit 346d758

Please sign in to comment.