Conversation
|
|
||
| if(redis.Query(std::vector<std::string>{"EXPIRE", key, std::to_string(expiry)}, result, true) != REDIS_REPLY_INTEGER) { | ||
| DARWIN_LOG_ERROR("AConnector::REDISSetExpiry:: not the expected Redis response"); | ||
| return -1; |
There was a problem hiding this comment.
implicit cast, this should return false
| _is_stop = true; | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
I see the logic is mostly hte same, I don't understand the need for a change in this method
There was a problem hiding this comment.
the change is in the position of the this->_cv.wait_for()
While we immediately started the task before, now it waits one iteration of _interval before launching it
| DARWIN_LOG_INFO("SumConnector:: REDISPopLogs:: key '" + sum_name + "' does not exist (yet?)"); | ||
| return false; | ||
| DARWIN_LOG_DEBUG("SumConnector:: REDISPopLogs:: key '" + sum_name + "' did not exist"); | ||
| result = std::string("0"); |
There was a problem hiding this comment.
This modification seems to be done to resolve an issue that I don't know nor can identify the issue, I can't review it
There was a problem hiding this comment.
When Redis returns a NIL, it means that the key does not exist
For our use, the key might not exist yet, so this is not an invalid read (so we mustn't return false)
However, I can't remember why I casted the value to std::string("0") here, but I will improve the code
| else { | ||
| DARWIN_LOG_ERROR("SumConnector::REDISListLen:: Error while querying key '" + sum_name + "'"); | ||
| result = 0.0L; | ||
| return -1; |
There was a problem hiding this comment.
This modification seems to be done to resolve an issue that I don't know nor can identify the issue, I can't review it
There was a problem hiding this comment.
the previous return didn't specify an error in the process, now it does (and is checked in BufferThread.cpp:34)
f5246e1 to
af58aa4
Compare
automatically set an expiration time (interval time + 60 seconds) to each cache key this avoids changing a buffer filter's configuration and having keys left unused on Redis
…ring return on REDISSetExpiry
✨ Buffer fixes and improvements
📃 Type of change
Please delete options that are not relevant.
Bug fix: non-breaking change which fixes an issue.
💡 Related Issue(s)
✒️ Description
Fixed
Added
🎯 Test Environments
Ubuntu (18.04)
✔️ Checklist: