(device protocol.DeviceID, id protocol.IndexID)
| 65 | } |
| 66 | |
| 67 | func (s *folderDB) SetIndexID(device protocol.DeviceID, id protocol.IndexID) error { |
| 68 | s.updateLock.Lock() |
| 69 | defer s.updateLock.Unlock() |
| 70 | |
| 71 | deviceIdx, err := s.deviceIdxLocked(device) |
| 72 | if err != nil { |
| 73 | return wrap(err, "device idx") |
| 74 | } |
| 75 | |
| 76 | if _, err := s.stmt(` |
| 77 | INSERT OR REPLACE INTO indexids (device_idx, index_id, sequence) values (?, ?, 0) |
| 78 | `).Exec(deviceIdx, indexIDToHex(id)); err != nil { |
| 79 | return wrap(err, "insert") |
| 80 | } |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | func (s *folderDB) DropAllIndexIDs() error { |
| 85 | s.updateLock.Lock() |
nothing calls this directly
no test coverage detected