(hash string, item *Item)
| 112 | } |
| 113 | |
| 114 | func (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 | |
| 134 | func (this *SQLiteFileList) Exist(hash string) (bool, int64, error) { |
| 135 | var db = this.GetDB(hash) |