Skip to content

Commit

Permalink
[sm,launcher] Setup instance monitor before its started
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Lohvynenko <[email protected]>
  • Loading branch information
mlohvynenko committed Feb 3, 2025
1 parent e4293fb commit 8056108
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sm/launcher/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ Error Instance::Start()
return err;
}

if (auto err = SetupMonitoring(); !err.IsNone()) {
return AOS_ERROR_WRAP(err);

Check warning on line 123 in src/sm/launcher/instance.cpp

View check run for this annotation

Codecov / codecov/patch

src/sm/launcher/instance.cpp#L123

Added line #L123 was not covered by tests
}

auto runStatus = mRunner.StartInstance(mInstanceID, mRuntimeDir, {});

mRunState = runStatus.mState;
Expand All @@ -127,8 +131,8 @@ Error Instance::Start()
return AOS_ERROR_WRAP(runStatus.mError);
}

if (auto err = SetupMonitoring(); !err.IsNone()) {
return err;
if (auto err = mResourceMonitor.UpdateInstanceRunState(mInstanceID, mRunState); !err.IsNone()) {
return AOS_ERROR_WRAP(err);

Check warning on line 135 in src/sm/launcher/instance.cpp

View check run for this annotation

Codecov / codecov/patch

src/sm/launcher/instance.cpp#L135

Added line #L135 was not covered by tests
}

return ErrorEnum::eNone;
Expand Down

0 comments on commit 8056108

Please sign in to comment.