Since sqlite 3.34[1] deleting a record in a fts5 table that doesn't
exist became an error. The resuls it that adding a torrent "corrupts"
the database and magnetico fails with this error:
Could not add new torrent to the database.
tx.Exec (INSERT OR REPLACE INTO torrents) database disk image is malformed
The problem can be simply avoided by setting modified_on = discovered_on
when inserting the torrent, instead of updating it afterwards with a
trigger.
[1]: 86f477edaa
- value returned from last_insert_rowid() is now checked
- INSERT OR IGNORE INTO torrents is removed in favour of explicitly checking if the torrent is in the database
- changed trigger names for keeping 'torrents_idx' up to date
- fixed 'modified_on' once again, but this time for sure (it seems...)
magneticod:
!!! disabled the gradual increase in congestion control, for some reason we still can't detect congestion...
- `*net.UDPAddr` in dht/mainline instead of `net.Addr`
- fixed a bug when a very small extension message received
- simplified how peer adress is handled in bittorrent/metadata/sink
- simplified TrawlingResult in dht/mainline
magneticow:
- use WAL for sqlite3
persistence:
- use URL.String() instead of url.Path in sql.Open() so that URL parameters are not lost...