Refactor Execution Status and Agent State Enums in Design Document
- Renamed the `Status` type to `ExecStatus` for clarity in execution status representation. - Introduced a new `AgentState` type to define the operational states of the agent, enhancing the structure of the design document. - Updated relevant sections to reflect these changes, improving overall readability and understanding of the agent's execution and operational context.
This commit is contained in:
parent
e318455bc2
commit
b19597808d
1 changed files with 18 additions and 9 deletions
|
|
@ -397,14 +397,23 @@ const (
|
||||||
DeliveryNotify DeliveryType = "notify"
|
DeliveryNotify DeliveryType = "notify"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status - execution status enum
|
// ExecStatus - execution status enum
|
||||||
type Status string
|
type ExecStatus string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
StatusPending Status = "pending"
|
ExecPending ExecStatus = "pending"
|
||||||
StatusRunning Status = "running"
|
ExecRunning ExecStatus = "running"
|
||||||
StatusCompleted Status = "completed"
|
ExecCompleted ExecStatus = "completed"
|
||||||
StatusFailed Status = "failed"
|
ExecFailed ExecStatus = "failed"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AgentState - agent operational state enum
|
||||||
|
type AgentState string
|
||||||
|
|
||||||
|
const (
|
||||||
|
AgentActive AgentState = "active" // ready to run
|
||||||
|
AgentPaused AgentState = "paused" // manually paused
|
||||||
|
AgentRunning AgentState = "running" // currently executing
|
||||||
)
|
)
|
||||||
|
|
||||||
// Triggers - all on by default
|
// Triggers - all on by default
|
||||||
|
|
@ -766,13 +775,13 @@ type EventRequest struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExecutionResult struct {
|
type ExecutionResult struct {
|
||||||
ExecutionID string // Job execution ID
|
ExecutionID string // Job execution ID
|
||||||
Status Status
|
Status ExecStatus // pending | running | completed | failed
|
||||||
}
|
}
|
||||||
|
|
||||||
type AgentStatus struct {
|
type AgentStatus struct {
|
||||||
AgentID string
|
AgentID string
|
||||||
Status string // active | paused | running
|
State AgentState // active | paused | running
|
||||||
LastRun time.Time
|
LastRun time.Time
|
||||||
NextRun time.Time
|
NextRun time.Time
|
||||||
RunningID string // current execution ID if running
|
RunningID string // current execution ID if running
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue