Use ProcessGet instead of ProcessList for fetch a single process

This commit is contained in:
Ingo Oppermann
2025-07-09 16:48:13 +02:00
parent e6b90c9657
commit 4253316e7a
2 changed files with 14 additions and 10 deletions

View File

@@ -423,6 +423,18 @@ func (n *Core) ProcessValidateConfig(config *app.Config) error {
return client.ProcessValidateConfig(config)
}
func (n *Core) ProcessGet(id app.ProcessID, filter []string) (api.Process, error) {
n.lock.RLock()
client := n.client
n.lock.RUnlock()
if client == nil {
return api.Process{}, ErrNoPeer
}
return client.Process(id, filter)
}
func (n *Core) ProcessList(options client.ProcessListOptions) ([]api.Process, error) {
n.lock.RLock()
client := n.client