Open jamemackson opened 7 years ago
This needs some thought indeed. I like the idea of the error though the current implementation is somewhat flawed.
Adding:
request[requestKey] = {
enabled: enabled
};
at the beginning of getFromRedis
partially fixes the issue (in the old/current situation when enabled
is false, you get the error, this fix avoids that) though this does not help w/ lux-unless. Let me think about this a bit.
Here in
addToRedis
we're throwing an error if the request key is not found which will be the case anytimegetFromRedis
is skipped via lux-unless. I'm thinking that we should allowaddToRedis
to noop if the requestKey is not present.I suppose we could also require the implementor to put
addToRedis
in a matchingunless
rule but that feels counter to how we're configuring everything in the beforeAction and letting those rules flow through.