(homePaths aghconfig.HomePaths, deps commandDeps)
| 307 | } |
| 308 | |
| 309 | func 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 | |
| 328 | func daemonStatusWithState(runtime *runtimeContext, info aghdaemon.Info, status string) DaemonStatus { |
| 329 | networkStatus := daemonNetworkStatusFromInfo(&runtime.Config, info.Network) |
no test coverage detected