chiark / gitweb /
disorder-rescan can now suppress the check phase, which on first
authorRichard Kettlewell <richard@fanticule>
Mon, 31 Dec 2007 16:13:44 +0000 (16:13 +0000)
committerRichard Kettlewell <richard@fanticule>
Mon, 31 Dec 2007 16:13:44 +0000 (16:13 +0000)
commitffac51d73ab97c4c9c1e6c43b18d54d716000bf6
treeebf02b0a3e1ca0412a7feb5fb892866bae76deaf
parent5ec96a135503c17ab00a2a7a4b5a940b3819d3f6
disorder-rescan can now suppress the check phase, which on first
startup with lots of tracks is rather time consuming.

Additionally, it avoids doing most of the work inside a transaction,
by the rather brute expedient of pulling the entire track list into
memory and then iterating over that.

The server takes advantage of this by making the initial blocking
rescan not do the check phase, so it's reasonably quick, and then
issuing a second non-blocking rescan immediately.

It might be better all round to calculate track lengths on demand but
this arrangement should be better than previously.
lib/trackdb.c
lib/trackdb.h
server/disorderd.c
server/rescan.c
server/server.c
server/state.c