mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-04 12:39:06 +02:00
[client, management] auto-update (#4732)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/netbirdio/netbird/client/internal/updatemanager/installer"
|
||||
"github.com/netbirdio/netbird/client/proto"
|
||||
)
|
||||
|
||||
func (s *Server) GetInstallerResult(ctx context.Context, _ *proto.InstallerResultRequest) (*proto.InstallerResultResponse, error) {
|
||||
inst := installer.New()
|
||||
dir := inst.TempDir()
|
||||
|
||||
rh := installer.NewResultHandler(dir)
|
||||
result, err := rh.Watch(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("failed to watch update result: %v", err)
|
||||
return &proto.InstallerResultResponse{
|
||||
Success: false,
|
||||
ErrorMsg: err.Error(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &proto.InstallerResultResponse{
|
||||
Success: result.Success,
|
||||
ErrorMsg: result.Error,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user