mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
fix: restore missing logic from refactoring
- Restore HTTP 400 status handling in log viewing that was lost during refactoring - Restore service installation check in restart command that was missing after refactoring
This commit is contained in:
committed by
Cuong Manh Le
parent
ea98a59aba
commit
954395fa29
@@ -2,8 +2,10 @@ package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/kardianos/service"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -19,6 +21,11 @@ func (sc *ServiceCommand) Restart(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := s.Status(); errors.Is(err, service.ErrNotInstalled) {
|
||||
mainLog.Load().Warn().Msg("service not installed")
|
||||
return nil
|
||||
}
|
||||
|
||||
p.cfg = &cfg
|
||||
if iface == "" {
|
||||
iface = "auto"
|
||||
|
||||
Reference in New Issue
Block a user