Skip to content

Commit 5afbf5e

Browse files
committed
add nil checks
1 parent 9154c43 commit 5afbf5e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

router/handle.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ func (rt *Handle) commitStatusList(workerJobStatuses *[]workerJobStatus) {
299299
if rt.throttlerFactory != nil {
300300
rt.throttlerFactory.Get(rt.destType, parameters.DestinationID).ResponseCodeReceived(errorCode) // send response code to throttler
301301
} else {
302-
rt.logger.Debugf("[%v Router] :: ThrottlerFactory is nil. Not sending response code to throttler", rt.destType)
302+
rt.logger.Debugf(`[%v Router] :: ThrottlerFactory is nil. Not throttling destination with ID %s`,
303+
rt.destType, parameters.DestinationID,
304+
)
303305
}
304306
// Update metrics maps
305307
// REPORTING - ROUTER - START

router/handle_lifecycle.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ func (rt *Handle) Shutdown() {
350350
rt.backgroundCancel()
351351

352352
<-rt.startEnded // wait for all workers to stop first
353-
rt.throttlerFactory.Shutdown()
353+
if rt.throttlerFactory != nil {
354+
rt.throttlerFactory.Shutdown()
355+
}
354356
close(rt.responseQ) // now it is safe to close the response channel
355357
_ = rt.backgroundWait()
356358
}

0 commit comments

Comments
 (0)