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

Method Add

internal/caches/list_file_sqlite.go:114–132  ·  view source on GitHub ↗
(hash string, item *Item)

Source from the content-addressed store, hash-verified

112}
113
114func (this *SQLiteFileList) Add(hash string, item *Item) error {
115 var db = this.GetDB(hash)
116
117 if !db.IsReady() {
118 return nil
119 }
120
121 err := db.AddSync(hash, item)
122 if err != nil {
123 return err
124 }
125
126 this.memoryCache.Write(hash, zero.Zero{}, this.maxExpiresAtForMemoryCache(item.ExpiresAt))
127
128 if this.onAdd != nil {
129 this.onAdd(item)
130 }
131 return nil
132}
133
134func (this *SQLiteFileList) Exist(hash string) (bool, int64, error) {
135 var db = this.GetDB(hash)

Callers 1

UpgradeV3Method · 0.95

Calls 5

GetDBMethod · 0.95
AddSyncMethod · 0.80
IsReadyMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected