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