From 90cc3bda2c733e4ad73363911086411de3ff0472 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 25 Feb 2012 17:06:19 +0100 Subject: [PATCH] Added: Task manager dump commands to pipeline service. --HG-- branch : build_pipeline_v3 --- .../pipeline_service/database_status.cpp | 4 +++- .../pipeline_service/pipeline_service.cpp | 24 +++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/pipeline/pipeline_service/database_status.cpp b/code/nel/tools/pipeline/pipeline_service/database_status.cpp index 7103c621e..058e47bd4 100644 --- a/code/nel/tools/pipeline/pipeline_service/database_status.cpp +++ b/code/nel/tools/pipeline/pipeline_service/database_status.cpp @@ -318,13 +318,15 @@ public: } bool done = false; - if (!CallbackCalled) + if (!CallbackCalled && Ready) { done = true; CallbackCalled = true; } Mutex.leave(); + nlassert(FilesUpdated == FilesRequested); + if (done) doneRemove(); } diff --git a/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp b/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp index 0659cf295..85eeba53d 100644 --- a/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp +++ b/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp @@ -405,7 +405,7 @@ NLMISC_COMMAND(reloadSheets, "Reload all sheets.", "") if(args.size() != 0) return false; if (!PIPELINE::reloadSheets()) { - nlinfo("I'm afraid I cannot do this, my friend."); + log.displayNL("I'm afraid I cannot do this, my friend."); return false; } return true; @@ -416,12 +416,32 @@ NLMISC_COMMAND(updateDatabaseStatus, "Updates the entire database status. This a if(args.size() != 0) return false; if (!PIPELINE::updateDatabaseStatus()) { - nlinfo("I'm afraid I cannot do this, my friend."); + log.displayNL("I'm afraid I cannot do this, my friend."); return false; } return true; } +NLMISC_COMMAND(dumpTaskManager, "Dumps the task manager.", "") +{ + if(args.size() != 0) return false; + std::vector output; + PIPELINE::s_TaskManager->dump(output); + for (std::vector::iterator it = output.begin(), end = output.end(); it != end; ++it) + log.displayNL("DUMP: %s", (*it).c_str()); + return true; +} + +NLMISC_COMMAND(dumpAsyncFileManager, "Dumps the async file manager.", "") +{ + if(args.size() != 0) return false; + std::vector output; + NLMISC::CAsyncFileManager::getInstance().dump(output); + for (std::vector::iterator it = output.begin(), end = output.end(); it != end; ++it) + log.displayNL("DUMP: %s", (*it).c_str()); + return true; +} + NLNET_SERVICE_MAIN(PIPELINE::CPipelineService, PIPELINE_SHORT_SERVICE_NAME, PIPELINE_LONG_SERVICE_NAME, 0, PIPELINE::s_ShardCallbacks, PIPELINE_SERVICE_DIRECTORY, PIPELINE_SERVICE_DIRECTORY) /* end of file */