Log a more meaningful error message and exit when another instance is started off the same data directory.

This commit is contained in:
kishorenc 2019-10-06 08:57:03 +05:30
parent 457bbcf467
commit 4d53a62784
2 changed files with 8 additions and 0 deletions

View File

@ -74,6 +74,13 @@ public:
if(!s.ok()) {
LOG(ERR) << "Error while initializing store: " << s.ToString();
if(s.code() == rocksdb::Status::Code::kIOError) {
LOG(ERR) << "It seems like the data directory " << state_dir_path << " is already being used by "
<< "another Typesense server. ";
LOG(ERR) << "If you are SURE that this is not the case, delete the LOCK file "
<< "in the data directory and try again.";
exit(1);
}
}
assert(s.ok());

View File

@ -1,6 +1,7 @@
#include "core_api.h"
#include "typesense_server_utils.h"
#include <curl/curl.h>
#include <sys/stat.h>
HttpServer* server;