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

Method CleanExpired

internal/metrics/task_sqlite.go:294–315  ·  view source on GitHub ↗

CleanExpired 清理数据

()

Source from the content-addressed store, hash-verified

292
293// CleanExpired 清理数据
294func (this *SQLiteTask) CleanExpired() error {
295 if this.isStopped {
296 return nil
297 }
298
299 // 清除低版本数据
300 if this.cleanVersion < this.itemConfig.Version {
301 _, err := this.deleteByVersionStmt.Exec(this.itemConfig.Version)
302 if err != nil {
303 return err
304 }
305 this.cleanVersion = this.itemConfig.Version
306 }
307
308 // 清除过期的数据
309 _, err := this.deleteByExpiresTimeStmt.Exec(this.itemConfig.LocalExpiresTime())
310 if err != nil {
311 return err
312 }
313
314 return nil
315}
316
317// Upload 上传数据
318func (this *SQLiteTask) Upload(pauseDuration time.Duration) error {

Callers 1

StartMethod · 0.95

Calls 1

ExecMethod · 0.45

Tested by

no test coverage detected