-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
catch deployment failure (usually oom)
- Loading branch information
1 parent
1ca3c3b
commit 8165894
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
// 2011-12-01 GONG Chen <[email protected]> | ||
// | ||
#include <chrono> | ||
#include <exception> | ||
#include <utility> | ||
#include <boost/date_time/posix_time/posix_time_types.hpp> | ||
#include <boost/filesystem.hpp> | ||
|
@@ -82,10 +83,15 @@ bool Deployer::Run() { | |
int failure = 0; | ||
do { | ||
while (auto task = NextTask()) { | ||
if (task->Run(this)) | ||
++success; | ||
else | ||
try { | ||
if (task->Run(this)) | ||
++success; | ||
else | ||
++failure; | ||
} catch (const std::exception& ex) { | ||
++failure; | ||
LOG(ERROR) << "Error deploying: " << ex.what(); | ||
} | ||
// boost::this_thread::interruption_point(); | ||
} | ||
LOG(INFO) << success + failure << " tasks ran: " << success << " success, " | ||
|