Skip to content

Commit

Permalink
catch deployment failure (usually oom) (rime#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored and graphemecluster committed Sep 23, 2023
1 parent b3b5fea commit e0221c8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rime/deployer.cc
Expand Up @@ -5,6 +5,7 @@
// 2011-12-01 GONG Chen <chen.sst@gmail.com>
//
#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 e0221c8

Please sign in to comment.