Skip to content

Commit

Permalink
Implement keysTouchedByScript
Browse files Browse the repository at this point in the history
  • Loading branch information
omnibs committed May 22, 2024
1 parent cc6a51e commit bf28b5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion nri-redis/src/Redis/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,17 @@ mapKeys fn script' = do

-- | Get the keys touched by the script
keysTouchedByScript :: Script a -> Set.Set Text
keysTouchedByScript = Debug.todo "keysTouchedByScript"
keysTouchedByScript script' =
script'
|> params
|> Log.unSecret
|> List.filterMap
( \param ->
case kind param of
RedisKey -> Just (value param)
ArbitraryValue -> Nothing
)
|> Set.fromList

-- | Get the parameter names in the script
paramNames :: Script a -> List Text
Expand Down

0 comments on commit bf28b5a

Please sign in to comment.