MCPcopy Create free account
hub / github.com/astercloud/aster / syncLoop

Method syncLoop

pkg/asteros/interfaces/agui.go:185–201  ·  view source on GitHub ↗

syncLoop 同步循环

(ctx context.Context)

Source from the content-addressed store, hash-verified

183
184// syncLoop 同步循环
185func (i *AGUIInterface) syncLoop(ctx context.Context) {
186 ticker := time.NewTicker(i.opts.SyncInterval)
187 defer ticker.Stop()
188
189 for {
190 select {
191 case <-ctx.Done():
192 return
193 case <-ticker.C:
194 if err := i.syncAll(); err != nil {
195 if i.opts.EnableLogging {
196 fmt.Printf(" [AGUI] Sync error: %v\n", err)
197 }
198 }
199 }
200 }
201}
202
203// syncAll 同步所有资源
204func (i *AGUIInterface) syncAll() error {

Callers 1

StartMethod · 0.95

Calls 3

syncAllMethod · 0.95
PrintfMethod · 0.80
StopMethod · 0.65

Tested by

no test coverage detected