MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Loop

Method Loop

internal/nodes/task_ocsp_update.go:65–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func (this *OCSPUpdateTask) Loop() error {
66 rpcClient, err := rpc.SharedRPC()
67 if err != nil {
68 return err
69 }
70
71 resp, err := rpcClient.SSLCertRPC.ListUpdatedSSLCertOCSP(rpcClient.Context(), &pb.ListUpdatedSSLCertOCSPRequest{
72 Version: this.version,
73 Size: 100,
74 })
75 if err != nil {
76 return err
77 }
78
79 for _, ocsp := range resp.SslCertOCSP {
80 // 更新OCSP
81 if sharedNodeConfig != nil {
82 sharedNodeConfig.UpdateCertOCSP(ocsp.SslCertId, ocsp.Data, ocsp.ExpiresAt)
83 }
84
85 // 修改版本
86 this.version = ocsp.Version
87 }
88
89 return nil
90}
91
92func (this *OCSPUpdateTask) Stop() {
93 this.ticker.Stop()

Callers 4

StartMethod · 0.95
TestOCSPUpdateTask_LoopFunction · 0.45
TestOriginManager_LoopFunction · 0.45

Calls 2

SharedRPCFunction · 0.92
ContextMethod · 0.80

Tested by 3

TestOCSPUpdateTask_LoopFunction · 0.36
TestOriginManager_LoopFunction · 0.36