forked from Silverfish/proton-bridge
GODT-1753: implement reset [skip-ci]
This commit is contained in:
@ -338,6 +338,13 @@ func (s *Service) restart() {
|
||||
s.log.Error("Restart is not implemented") // TO-DO GODT-1671 implement restart.
|
||||
}
|
||||
|
||||
func (s *Service) triggerReset() {
|
||||
defer func() {
|
||||
_ = s.SendEvent(NewResetFinishedEvent())
|
||||
}()
|
||||
s.bridge.FactoryReset()
|
||||
}
|
||||
|
||||
func (s *Service) checkUpdate() {
|
||||
version, err := s.updater.Check()
|
||||
if err != nil {
|
||||
|
||||
@ -188,6 +188,10 @@ func (s *Service) GoOs(context.Context, *emptypb.Empty) (*wrapperspb.StringValue
|
||||
|
||||
func (s *Service) TriggerReset(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
|
||||
s.log.Info("TriggerReset")
|
||||
go func() {
|
||||
defer s.panicHandler.HandlePanic()
|
||||
s.triggerReset()
|
||||
}()
|
||||
return nil, ErrNotImplemented
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user