From 2704c0b203a4f2ded56f8f7e39711c7b86314c6a Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Wed, 6 Nov 2024 18:28:38 +0800 Subject: [PATCH] cmd/server: update releasemanage module --- cmd/server/resourcemanage/resourcemanage.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/server/resourcemanage/resourcemanage.go b/cmd/server/resourcemanage/resourcemanage.go index 76cf4a6..6e3ee4e 100644 --- a/cmd/server/resourcemanage/resourcemanage.go +++ b/cmd/server/resourcemanage/resourcemanage.go @@ -34,15 +34,19 @@ func (e *FinalError) Error() string { type ErrorReleaseManagement struct { ErrChan chan error + errEndChan chan struct{} + + // cancelCtx: 控制 ERManager 本身资源释放的上下文,子上下文:errortransmit cancelCtx context.Context cancelFunc context.CancelFunc + + // GoCancelCtx: ERManager 用于控制项目指定goroutine优雅退出的上下文 GoCancelCtx context.Context GoCancelFunc context.CancelFunc Wg sync.WaitGroup - errEndChan chan struct{} - + // releaseFunc: 项目整体资源释放回调函数 releaseFunc ResourceReleaseFunction } -- Gitee