mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Add Restarting state
This commit is contained in:
@@ -350,6 +350,10 @@ func (p *process) handleAutoRestart(err error) {
|
||||
maxRestarts := *opts.MaxRestarts
|
||||
|
||||
p.restarts++
|
||||
|
||||
// Set status to Restarting instead of leaving as Stopped
|
||||
p.instance.SetStatus(Restarting)
|
||||
|
||||
log.Printf("Auto-restarting instance %s (attempt %d/%d) in %v",
|
||||
p.instance.Name, p.restarts, maxRestarts, time.Duration(restartDelay)*time.Second)
|
||||
|
||||
|
||||
@@ -13,18 +13,21 @@ const (
|
||||
Stopped Status = iota
|
||||
Running
|
||||
Failed
|
||||
Restarting
|
||||
)
|
||||
|
||||
var nameToStatus = map[string]Status{
|
||||
"stopped": Stopped,
|
||||
"running": Running,
|
||||
"failed": Failed,
|
||||
"stopped": Stopped,
|
||||
"running": Running,
|
||||
"failed": Failed,
|
||||
"restarting": Restarting,
|
||||
}
|
||||
|
||||
var statusToName = map[Status]string{
|
||||
Stopped: "stopped",
|
||||
Running: "running",
|
||||
Failed: "failed",
|
||||
Stopped: "stopped",
|
||||
Running: "running",
|
||||
Failed: "failed",
|
||||
Restarting: "restarting",
|
||||
}
|
||||
|
||||
// Status enum JSON marshaling methods
|
||||
|
||||
Reference in New Issue
Block a user