MCPcopy Create free account
hub / github.com/deepflowio/deepflow / tryRefresh

Method tryRefresh

server/controller/recorder/domain.go:121–142  ·  view source on GitHub ↗
(cloudData cloudmodel.Resource)

Source from the content-addressed store, hash-verified

119}
120
121func (d *domain) tryRefresh(cloudData cloudmodel.Resource) error {
122 // 无论是否会更新资源,需先更新domain及subdomain状态
123 d.updateStateInfo(cloudData)
124
125 if err := d.shouldRefresh(cloudData); err != nil {
126 return err
127 }
128
129 select {
130 case <-d.cache.RefreshSignal:
131 d.cache.IncrementSequence()
132 d.cache.SetLogLevel(logging.INFO, cache.RefreshSignalCallerDomain)
133
134 d.refresh(cloudData)
135
136 d.cache.ResetRefreshSignal(cache.RefreshSignalCallerDomain)
137 return nil
138 default:
139 log.Info("domain refresh is running, does nothing", d.metadata.LogPrefixes)
140 return RefreshConflictError
141 }
142}
143
144func (d *domain) shouldRefresh(cloudData cloudmodel.Resource) error {
145 if cloudData.Verified {

Callers 1

Calls 7

updateStateInfoMethod · 0.95
shouldRefreshMethod · 0.95
refreshMethod · 0.95
IncrementSequenceMethod · 0.80
ResetRefreshSignalMethod · 0.80
SetLogLevelMethod · 0.45
InfoMethod · 0.45

Tested by

no test coverage detected