Skip to content

Commit

Permalink
catch deployment failure (usually oom)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Sep 23, 2023
1 parent 1ca3c3b commit 8165894
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rime/deployer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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, "
Expand Down

0 comments on commit 8165894

Please sign in to comment.