mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-22 17:14:22 +00:00
Fix instance deletion check to account for restarting status
This commit is contained in:
@@ -330,7 +330,8 @@ func (im *instanceManager) DeleteInstance(name string) error {
|
|||||||
lock.Lock()
|
lock.Lock()
|
||||||
defer im.unlockAndCleanup(name)
|
defer im.unlockAndCleanup(name)
|
||||||
|
|
||||||
if inst.IsRunning() {
|
status := inst.GetStatus()
|
||||||
|
if status == instance.Running || status == instance.Restarting {
|
||||||
return fmt.Errorf("instance with name %s is still running, stop it before deleting", name)
|
return fmt.Errorf("instance with name %s is still running, stop it before deleting", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user