Add status command to agent and cleanup code #544

Closed
opened 2026-04-05 16:20:26 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @anxuanzi on 2/27/2025

This pull request includes several important changes to the InfrastructureAgent to improve the codebase and update dependencies. The most significant changes include upgrading the Go version and dependencies, refactoring the service struct, and adding a new command to check the service status.

Dependency Updates:

  • Upgraded Go version from 1.22.0 to 1.23.0 and added a toolchain for Go 1.24.0.
  • Updated various dependencies in go.mod to their latest versions.

Code Refactoring:

  • Refactored the service struct from program to agentService to improve clarity and maintainability.
  • Replaced the exit channel with stopChan for better naming consistency.
  • Updated the main function to use the new agentService struct and improved error handling and logging. [1] [2] [3] [4]

New Features:

  • Added a new status command to check whether the service is running, stopped, or in an unknown state.
*Originally created by @anxuanzi on 2/27/2025* This pull request includes several important changes to the `InfrastructureAgent` to improve the codebase and update dependencies. The most significant changes include upgrading the Go version and dependencies, refactoring the service struct, and adding a new command to check the service status. ### Dependency Updates: * Upgraded Go version from 1.22.0 to 1.23.0 and added a toolchain for Go 1.24.0. * Updated various dependencies in `go.mod` to their latest versions. ### Code Refactoring: * Refactored the service struct from `program` to `agentService` to improve clarity and maintainability. * Replaced the `exit` channel with `stopChan` for better naming consistency. * Updated the `main` function to use the new `agentService` struct and improved error handling and logging. [[1]](diffhunk://#diff-4616422363b831789900c9f9bdaeb4c2a9cc9ef75fe46859ba3cc11922e67bacL97-R117) [[2]](diffhunk://#diff-4616422363b831789900c9f9bdaeb4c2a9cc9ef75fe46859ba3cc11922e67bacL148-R137) [[3]](diffhunk://#diff-4616422363b831789900c9f9bdaeb4c2a9cc9ef75fe46859ba3cc11922e67bacL170-R146) [[4]](diffhunk://#diff-4616422363b831789900c9f9bdaeb4c2a9cc9ef75fe46859ba3cc11922e67bacL179-R189) ### New Features: * Added a new `status` command to check whether the service is running, stopped, or in an unknown state.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#544