From d853a44a8576269317228597a874eba2e23f1a10 Mon Sep 17 00:00:00 2001
From: joshemb <josh@elixxir.io>
Date: Wed, 28 Sep 2022 16:00:05 -0700
Subject: [PATCH] Debug

---
 fileTransfer/manager.go | 8 +++-----
 stoppable/multi.go      | 6 +++---
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/fileTransfer/manager.go b/fileTransfer/manager.go
index c6058ed7e..6c6aa0575 100644
--- a/fileTransfer/manager.go
+++ b/fileTransfer/manager.go
@@ -215,7 +215,7 @@ func NewManager(params Params, user FtE2e) (FileTransfer, error) {
 // StartProcesses starts the sending threads. Adheres to the xxdk.Service type.
 func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
 	// Construct stoppables
-	sendStoppable := stoppable.NewMulti(workerPoolStoppable)
+	multiStoppable := stoppable.NewMulti(fileTransferStoppable)
 	batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable)
 
 	// Start sending threads
@@ -226,14 +226,12 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
 	// running this asynchronously could result in a race condition where
 	// some worker threads are not added to senderPoolStop before that stoppable
 	// is added to the multiStoppable.
-	m.startSendingWorkerPool(sendStoppable)
+	m.startSendingWorkerPool(multiStoppable)
 	jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
-		sendStoppable, sendStoppable.GetRunningProcesses())
+		multiStoppable, multiStoppable.GetRunningProcesses())
 
 	// Create a multi stoppable
-	multiStoppable := stoppable.NewMulti(fileTransferStoppable)
 	multiStoppable.Add(batchBuilderStop)
-	multiStoppable.Add(sendStoppable)
 
 	jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
 		multiStoppable.GetRunningProcesses(), multiStoppable)
diff --git a/stoppable/multi.go b/stoppable/multi.go
index 3230844f9..270f28a17 100644
--- a/stoppable/multi.go
+++ b/stoppable/multi.go
@@ -128,9 +128,9 @@ func (m *Multi) Close() error {
 		// Attempt to stop each stoppable in its own goroutine
 		for _, stoppable := range m.stoppables {
 			wg.Add(1)
-			jww.INFO.Printf("FT DEBUG: stopping %s", stoppable.Name())
-			go func(stoppable Stoppable) {
-				if stoppable.Close() != nil {
+			go func(s Stoppable) {
+				jww.INFO.Printf("FT DEBUG: stopping %s", s.Name())
+				if s.Close() != nil {
 					atomic.AddUint32(&numErrors, 1)
 				}
 				wg.Done()
-- 
GitLab