MCPcopy Create free account
hub / github.com/compozy/agh / daemonInfo

Function daemonInfo

internal/cli/daemon.go:309–326  ·  view source on GitHub ↗
(homePaths aghconfig.HomePaths, deps commandDeps)

Source from the content-addressed store, hash-verified

307}
308
309func daemonInfo(homePaths aghconfig.HomePaths, deps commandDeps) (aghdaemon.Info, bool, error) {
310 info, err := deps.readDaemonInfo(homePaths.DaemonInfo)
311 switch {
312 case err == nil:
313 case errors.Is(err, os.ErrNotExist):
314 return aghdaemon.Info{}, false, nil
315 default:
316 return aghdaemon.Info{}, false, err
317 }
318
319 if !deps.processAlive(info.PID) {
320 return info, false, nil
321 }
322 if !deps.processMatchesStartTime(info.PID, info.StartedAt) {
323 return info, false, nil
324 }
325 return info, true, nil
326}
327
328func daemonStatusWithState(runtime *runtimeContext, info aghdaemon.Info, status string) DaemonStatus {
329 networkStatus := daemonNetworkStatusFromInfo(&runtime.Config, info.Network)

Callers 11

newDaemonStopCommandFunction · 0.85
runDaemonForegroundFunction · 0.85
runDaemonDetachedFunction · 0.85
waitForDaemonStopFunction · 0.85
daemonStatusFromDepsFunction · 0.85
stopDaemonForUninstallFunction · 0.85
resolveUpdateRuntimeFunction · 0.85
rollbackAppliedUpdateFunction · 0.85
extensionClientIfRunningFunction · 0.85

Calls 2

processAliveMethod · 0.80
IsMethod · 0.45

Tested by

no test coverage detected