Fix generated run lifecycle profile scope
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user