(hash string, item *Item)
| 201 | } |
| 202 | |
| 203 | func (this *SQLiteFileListDB) AddSync(hash string, item *Item) error { |
| 204 | this.hashMap.Add(hash) |
| 205 | |
| 206 | if item.StaleAt == 0 { |
| 207 | item.StaleAt = item.ExpiresAt |
| 208 | } |
| 209 | |
| 210 | _, err := this.insertStmt.Exec(hash, item.Key, item.HeaderSize, item.BodySize, item.MetaSize, item.ExpiresAt, item.StaleAt, item.Host, item.ServerId, fasttime.Now().Unix()) |
| 211 | if err != nil { |
| 212 | return this.WrapError(err) |
| 213 | } |
| 214 | |
| 215 | return nil |
| 216 | } |
| 217 | |
| 218 | func (this *SQLiteFileListDB) DeleteSync(hash string) error { |
| 219 | this.hashMap.Delete(hash) |