void PeriodicTaskScheduler::schedulerThreadRun(TaskThread& task) { while (sleepThread(task.tmoMs)) { try { task.func(*this); } catch (const std::exception& ex) { LOG_FAILURE("mcrouter", failure::Category::kOther, "Error while executing periodic function: {}", ex.what()); break; } catch (...) { LOG_FAILURE("mcrouter", failure::Category::kOther, "Unknown error occured while executing periodic function"); break; } } }