From 3459c25be08c6cf0e7c4f720157bf8ad934c8052 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 10 Jan 2021 15:59:45 -0800 Subject: [PATCH] Don't block the proc --- cmd/root.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 18dccb8..0414c79 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -272,11 +272,13 @@ func rootCmdRun(cmd *cobra.Command, _ []string) { // Wait until all of the servers are ready to go before we fire up the SFTP and HTTP servers. pool.StopWait() - // Run the SFTP server. - if err := sftp.New().Run(); err != nil { - log.WithError(err).Fatal("failed to initialize the sftp server") - return - } + go func() { + // Run the SFTP server. + if err := sftp.New().Run(); err != nil { + log.WithError(err).Fatal("failed to initialize the sftp server") + return + } + }() // Ensure the archive directory exists. if err := os.MkdirAll(c.System.ArchiveDirectory, 0755); err != nil {