Skip to content

Commit

Permalink
Merge pull request #66 from sonroyaalmerol/remove-passthrough-proxy
Browse files Browse the repository at this point in the history
refactoring sftp servers and ensure graceful exits
  • Loading branch information
sonroyaalmerol authored Jan 13, 2025
2 parents 24218dd + 06abe6b commit d7798c1
Show file tree
Hide file tree
Showing 5 changed files with 434 additions and 252 deletions.
2 changes: 1 addition & 1 deletion cmd/windows_agent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (p *agentService) run() {
for _, drive := range drives {
driveLetters = append(driveLetters, drive)

err := sftp.InitializeSFTPConfig(drive)
err := sftp.InitializeSFTPConfig(p.ctx, drive)
if err != nil {
logger.Errorf("Unable to initialize SFTP config: %v", err)
return
Expand Down
8 changes: 1 addition & 7 deletions internal/agent/controllers/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ import (
var sftpSessions sync.Map

func WSHandler(ctx context.Context, c *websocket.Conn, m websockets.Message, infoChan chan string, errChan chan string) {
if m.Type == "ping" {
response := websockets.Message{
Type: "ping",
Content: "pong",
}
c.WriteJSON(response)
} else if m.Type == "backup_start" {
if m.Type == "backup_start" {
infoChan <- fmt.Sprintf("Received backup request for drive %s.", m.Content)

snapshot, err := snapshots.Snapshot(m.Content)
Expand Down
Loading

0 comments on commit d7798c1

Please sign in to comment.