feat: enhance context cancellation handling

This commit is contained in:
Fu Diwei
2025-04-23 19:32:21 +08:00
parent a90b6a8589
commit 97f102533c
31 changed files with 287 additions and 57 deletions

View File

@@ -74,6 +74,12 @@ func (u *UploaderProvider) Upload(ctx context.Context, certPEM string, privkeyPE
Source: bytepluscdn.GetStrPtr("cert_center"),
}
for {
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
}
listCertInfoResp, err := u.sdkClient.ListCertInfo(listCertInfoReq)
u.logger.Debug("sdk request 'cdn.ListCertInfo'", slog.Any("request", listCertInfoReq), slog.Any("response", listCertInfoResp))
if err != nil {