You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2024/01/02 07:22:05 UTC

Re: [PR] Add INFO comment when DB not scaned [kvrocks]

PragmaTwice commented on code in PR #1956:
URL: https://github.com/apache/kvrocks/pull/1956#discussion_r1439202121


##########
src/server/server.cc:
##########
@@ -1163,7 +1163,11 @@ void Server::GetInfo(const std::string &ns, const std::string &section, std::str
 
     if (section_cnt++) string_stream << "\r\n";
     string_stream << "# Keyspace\r\n";
-    string_stream << "# Last scan db time: " << std::put_time(&last_scan_tm, "%a %b %e %H:%M:%S %Y") << "\r\n";
+    if (last_scan_time == 0) {
+      string_stream << "# WARN: DB not scan, run `dbsize scan` command first.\r\n";
+    } else {
+      string_stream << "# Last scan DB time: " << std::put_time(&last_scan_tm, "%a %b %e %H:%M:%S %Y") << "\r\n";
+    }

Review Comment:
   I wonder why it is in comment rather than an normal key-value line like `last_scan_time:0`? cc @git-hulk 



-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org