From b708b39d9cd6e1ae582aa580073e057f0fcb0efb 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 2b2169ca41..f6761e5df9 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, "