From e0221c840ac6a5471f0fead89caec5dad927ff7d Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Fri, 22 Sep 2023 21:33:40 -0400 Subject: [PATCH] catch deployment failure (usually oom) (#719) --- src/rime/deployer.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/rime/deployer.cc b/src/rime/deployer.cc index 2b2169ca4..f6761e5df 100644 --- a/src/rime/deployer.cc +++ b/src/rime/deployer.cc @@ -5,6 +5,7 @@ // 2011-12-01 GONG Chen // #include +#include #include #include #include @@ -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, "