Fixed infinite loop bug in Service::BeginExecuteCheck.

This commit is contained in:
Gunnar Beutner 2013-02-08 11:22:42 +01:00
parent 7526ee3a9e
commit 39008eff4e
1 changed files with 3 additions and 1 deletions

View File

@ -661,7 +661,9 @@ void Service::BeginExecuteCheck(const function<void (void)>& callback)
arguments.push_back(static_cast<Service::Ptr>(GetSelf()));
ScriptTask::Ptr task;
task = InvokeMethod("check", arguments, boost::bind(&Service::CheckCompletedHandler, this, scheduleInfo, _1, callback));
Set("current_task", task);
if (!task->IsFinished())
Set("current_task", task);
} catch (...) {
/* something went wrong while setting up the method call -
* reschedule the service and call the callback anyway. */