From 0efbae4a487d6a444f0fee58fa217586d3c8268f Mon Sep 17 00:00:00 2001 From: Wendi Onwuakpa Date: Mon, 21 Oct 2024 17:05:10 -0400 Subject: [PATCH] removed nil channel sets --- ste/jobStatusManager.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/ste/jobStatusManager.go b/ste/jobStatusManager.go index 6650e01ff..b47466970 100755 --- a/ste/jobStatusManager.go +++ b/ste/jobStatusManager.go @@ -176,19 +176,17 @@ func (jm *jobMgr) handleStatusUpdateMessage() { case <-jstm.listReq: /* Display stats */ js.Timestamp = time.Now().UTC() - if jstm.respChan != nil { - select { - case jstm.respChan <- *js: - // Send on the channel - case <-jstm.statusMgrDone: - // If we time out, no biggie. This isn't world-ending, nor is it essential info. The other side stopped listening by now. - } - defer func() { // Exit gracefully if panic - if recErr := recover(); recErr != nil { - jm.Log(common.LogError, "Cannot send message on respChan") - } - }() + select { + case jstm.respChan <- *js: + // Send on the channel + case <-jstm.statusMgrDone: + // If we time out, no biggie. This isn't world-ending, nor is it essential info. The other side stopped listening by now. } + defer func() { // Exit gracefully if panic + if recErr := recover(); recErr != nil { + jm.Log(common.LogError, "Cannot send message on respChan") + } + }() // Reset the lists so that they don't keep accumulating and take up excessive memory // There is no need to keep sending the same items over and over again js.FailedTransfers = []common.TransferDetail{} @@ -198,8 +196,6 @@ func (jm *jobMgr) handleStatusUpdateMessage() { close(jstm.statusMgrDone) close(jstm.respChan) close(jstm.listReq) - jstm.listReq = nil - jstm.respChan = nil return } }