Do not upload minidumps when running unit tests or zone builder.

This commit is contained in:
/dev/urandom 2016-09-14 08:08:48 +02:00
parent e18ac7be16
commit 54f21d5a5d
No known key found for this signature in database
GPG Key ID: 41322B973E0F295E
2 changed files with 11 additions and 10 deletions

View File

@ -13,10 +13,10 @@ namespace Components
BitMessage::BitMessage() BitMessage::BitMessage()
{ {
#ifdef DEBUG #ifdef DEBUG
Logger::Print("Initializing BitMessage...\n"); Logger::Print("Initializing BitMessage...\n");
#endif // DEBUG #endif // DEBUG
BitMessage::BMClient = new BitMRC(BITMESSAGE_OBJECT_STORAGE_FILENAME, BITMESSAGE_KEYS_FILENAME); BitMessage::BMClient = new BitMRC(BITMESSAGE_OBJECT_STORAGE_FILENAME, BITMESSAGE_KEYS_FILENAME);
BitMessage::BMClient->init(); BitMessage::BMClient->init();
@ -36,7 +36,7 @@ Logger::Print("Initializing BitMessage...\n");
BitMessage::BMClient->start(); BitMessage::BMClient->start();
#ifdef DEBUG #ifdef DEBUG
Command::Add("bm_send", [](Command::Params params) Command::Add("bm_send", [](Command::Params params)
{ {
if (params.Length() < 3) return; if (params.Length() < 3) return;
@ -70,7 +70,7 @@ Logger::Print("Initializing BitMessage...\n");
Logger::Print("Broadcast done.\n"); Logger::Print("Broadcast done.\n");
}); });
Command::Add("bm_check_messages", [](Command::Params) Command::Add("bm_check_messages", [](Command::Params)
{ {
while (BitMessage::BMClient->new_messages.size() > 0) while (BitMessage::BMClient->new_messages.size() > 0)
{ {
@ -79,7 +79,7 @@ Logger::Print("Initializing BitMessage...\n");
} }
}); });
Command::Add("bm_check_connections", [](Command::Params) Command::Add("bm_check_connections", [](Command::Params)
{ {
std::shared_lock<std::shared_timed_mutex> mlock(BitMessage::BMClient->mutex_nodes); std::shared_lock<std::shared_timed_mutex> mlock(BitMessage::BMClient->mutex_nodes);
@ -104,7 +104,7 @@ Logger::Print("Initializing BitMessage...\n");
mlock.unlock(); mlock.unlock();
}); });
Command::Add("bm_check_privatekey", [](Command::Params) Command::Add("bm_check_privatekey", [](Command::Params)
{ {
std::shared_lock<std::shared_timed_mutex> mlock(BitMessage::BMClient->mutex_priv); std::shared_lock<std::shared_timed_mutex> mlock(BitMessage::BMClient->mutex_priv);
@ -123,7 +123,7 @@ Logger::Print("Initializing BitMessage...\n");
mlock.unlock(); mlock.unlock();
}); });
Command::Add("bm_check_publickey", [](Command::Params) Command::Add("bm_check_publickey", [](Command::Params)
{ {
std::shared_lock<std::shared_timed_mutex> mlock(BitMessage::BMClient->mutex_pub); std::shared_lock<std::shared_timed_mutex> mlock(BitMessage::BMClient->mutex_pub);
@ -140,12 +140,12 @@ Logger::Print("Initializing BitMessage...\n");
mlock.unlock(); mlock.unlock();
}); });
Command::Add("bm_save", [](Command::Params) Command::Add("bm_save", [](Command::Params)
{ {
BitMessage::Save(); BitMessage::Save();
}); });
Command::Add("bm_address_public", [](Command::Params params) Command::Add("bm_address_public", [](Command::Params params)
{ {
if (params.Length() < 2) return; if (params.Length() < 2) return;
@ -165,7 +165,7 @@ Logger::Print("Initializing BitMessage...\n");
} }
}); });
Command::Add("bm_address_broadcast", [](Command::Params params) Command::Add("bm_address_broadcast", [](Command::Params params)
{ {
if (params.Length() < 2) return; if (params.Length() < 2) return;

View File

@ -157,6 +157,7 @@ namespace Components
MinidumpUpload::MinidumpUpload() MinidumpUpload::MinidumpUpload()
{ {
#if !defined(DEBUG) || defined(FORCE_MINIDUMP_UPLOAD) #if !defined(DEBUG) || defined(FORCE_MINIDUMP_UPLOAD)
if (Loader::PerformingUnitTests() || ZoneBuilder::IsEnabled()) return;
this->uploadThread = std::thread([&]() { this->UploadQueuedMinidumps(); }); this->uploadThread = std::thread([&]() { this->UploadQueuedMinidumps(); });
#endif #endif
} }