1 parent
2e0f15af59
commit
b5065d02d4
1 file changed
+9
-11
+9
-11
@@ -334,18 +334,13 @@ namespace Echoion::Host
|
||||
Api::ErrorCode::NotFound,
|
||||
std::format("New library not found: {}", targetPath.string()));
|
||||
}
|
||||
if (targetPath != currentLibraryPath_) {
|
||||
return Api::fail(
|
||||
Api::ErrorCode::InvalidArgument,
|
||||
"in-process Core reload must use the loaded path; release "
|
||||
"bundles "
|
||||
"with a new path are applied through daemon re-exec");
|
||||
}
|
||||
if (!canCreateHotReloadCopy(targetPath)) {
|
||||
const bool replacingPath = targetPath != currentLibraryPath_;
|
||||
if (!replacingPath && !canCreateHotReloadCopy(targetPath)) {
|
||||
return Api::fail(
|
||||
Api::ErrorCode::PermissionDenied,
|
||||
"in-process Core reload requires a writable library directory; "
|
||||
"immutable releases are applied through daemon re-exec");
|
||||
"in-place Core reload requires a writable library directory; "
|
||||
"use "
|
||||
"an immutable versioned path for installed updates");
|
||||
}
|
||||
|
||||
hotReloading_ = true;
|
||||
@@ -376,7 +371,9 @@ namespace Echoion::Host
|
||||
}
|
||||
}
|
||||
|
||||
const auto reloadResult = pluginManager_.reload(pluginName_);
|
||||
const auto reloadResult =
|
||||
replacingPath ? pluginManager_.replace(pluginName_, targetPath)
|
||||
: pluginManager_.reload(pluginName_);
|
||||
if (!reloadResult) {
|
||||
hotReloading_ = false;
|
||||
auto message =
|
||||
@@ -410,6 +407,7 @@ namespace Echoion::Host
|
||||
hotReloading_ = false;
|
||||
return refreshed;
|
||||
}
|
||||
currentLibraryPath_ = targetPath;
|
||||
if (!state.empty()) {
|
||||
if (auto restored = core_->restoreState(state); !restored) {
|
||||
Void::Log::warn("CoreLoader",
|
||||
|
||||
Reference in new issue
Block a user