git-hulk commented on code in PR #628:
URL: https://github.com/apache/incubator-kvrocks/pull/628#discussion_r893427357


##########
src/event_listener.cc:
##########
@@ -59,6 +59,18 @@ const std::string compressType2String(const 
rocksdb::CompressionType type) {
   return iter->second;
 }
 
+bool isDiskQuotaExceeded(const rocksdb::Status &bg_error) {
+    // EDQUOT: Disk quota exceeded (POSIX.1-2001)
+    std::string edquot_str = "Disk quota exceeded";
+    std::string err_msg = bg_error.ToString();
+
+    if (err_msg.length() < edquot_str.length()) {
+        return false;
+    }
+
+    return edquot_str == err_msg.substr(err_msg.size()-edquot_str.size());

Review Comment:
   Yes, background error wasn't the hot path, so it will be good to make it 
more readable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to