Fix generated run lifecycle profile scope

This commit is contained in:
npc0-hue
2026-08-31 01:20:36 +08:00
parent 8194671656
commit fa2ce17ce3
4 changed files with 74 additions and 3 deletions
+16 -2
View File
@@ -2260,10 +2260,24 @@ func declaredPluginFileRequest(workspace domain.PluginFileWorkspace, request dom
func (svc *CoreService) runtimeProfileScope(serverInstanceID string) string {
binding, err := svc.runtimeBindingForServer(serverInstanceID)
if err != nil {
if err == nil && strings.TrimSpace(binding.ProfileKey) != "" {
return binding.ProfileKey
}
if err != nil && !errors.Is(err, repo.ErrNotFound) {
return "default"
}
return binding.ProfileKey
instance, instanceErr := svc.store.ServerInstances().Get(serverInstanceID)
if instanceErr != nil {
return "default"
}
plugin, pluginErr := svc.store.GamePlugins().Get(instance.PluginID)
if pluginErr != nil {
return "default"
}
if profileKey := lifecycleDefaultProfileKey(instance, plugin, instance.Deployment.ProfileKey); profileKey != "" {
return profileKey
}
return "default"
}
func (svc *CoreService) latestMetricsForServer(instance domain.ServerInstance) domain.ServerMetrics {