Don't write shutdown crashes
This commit is contained in:
parent
e99c1b442a
commit
03a0cec60e
@ -42,13 +42,17 @@ extern bool mainThreadDone;
|
||||
#ifdef BREAKPAD_EXCEPTION_HANDLER
|
||||
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) {
|
||||
if(ts::server::isShuttingDown()) {
|
||||
/* We don't care about this crash dump. Remove it. */
|
||||
std::error_code error_code{};
|
||||
fs::remove(fs::u8path(descriptor.path()), error_code);
|
||||
return true;
|
||||
}
|
||||
|
||||
logCritical(LOG_GENERAL, "The server crashed!");
|
||||
try {
|
||||
if(!fs::exists(fs::u8path(ts::config::crash_path)))
|
||||
if(!fs::exists(fs::u8path(ts::config::crash_path))) {
|
||||
fs::create_directories(fs::u8path(ts::config::crash_path));
|
||||
}
|
||||
|
||||
auto path = fs::u8path(descriptor.path());
|
||||
path = fs::u8path(ts::config::crash_path + "crash_dump_" + path.filename().string());
|
||||
|
Loading…
Reference in New Issue
Block a user