Open ddragosd opened 8 years ago
I've investigated and found that indeed the empty value is added to the cache in this line:
dict:set(rule.id .. " " .. rule.format, "", 0.001, 0)
Wouldn't it be better to just remove the key from the shared dictionary?
This is where the error occurs.
It seems to be an edge case and we need to add a try/catch for this scenario. I’m assuming this is happening when a rule expires and we have an incoming request in that millisecond and the shared dictionary returns an empty string for a rule causing the
cjson
lib to complain ?... one possiblityWe should wrap the
decode
into apcall
as follows: