Ah, that explains the infinite. (I should add loop there, but it looks more zen this way
)
But now I've got another oddity that I'll have to test a bit more.
So I change my loop to a while true with a break, and found that it still stayed forever busy.
So I changed it to a countdown of 6 times to continue even if busy after 6 iterations, and it now runs - but it seems like it runs one part of the upload but not the final part:
Code:
2011/06/06 20:52:56 Device is busy, sleeping
DEBUG: 22.0 USBMS: uploading 6 books
2011/06/06 20:52:59 Device is busy, sleeping
DEBUG: 26.8 USBMS: finished uploading 6 books
2011/06/06 20:53:02 Device is busy, sleeping
2011/06/06 20:53:05 Device is busy, sleeping
2011/06/06 20:53:08 Device is not busy, continuing (MAX OF 6 ITERATIONS REACHED)
LOTS OF KINDLE COLLECTION OUTPUT
Job: 3 Upload 6 books to device:Sense and Sensibility, Persuasion, Northanger Abbey, Mansfield Park, Emma, Pride and Prejudice finished
No details available.
DEBUG: 37.4 USBMS: adding metadata for 6 books
DEBUG: 37.5 USBMS: finished adding metadata
Job: 3 Upload 6 books to device:Sense and Sensibility, Persuasion, Northanger Abbey, Mansfield Park, Emma, Pride and Prejudice finished
No details available.
DEBUG: 38.8 USBMS: starting sync_booklists
DEBUG: 39.7 USBMS: finished sync_booklists
Job: 4 Send metadata to device finished
No details available.
It appears to upload the books ok, but then device stays busy forever and never uploads the metadata (I can see 1 Job sitting on the queue which must be the metadata upload, but of course the gui is frozen). If I use a max of 6 iterations as shown above its clear the metadata upload is done after the kindle collection code runs.
Its as if running the kindle collections is keeping the device busy (even though I'm not using jobs yet, and I haven't starting reading the book info from the kindle yet, although I have got the device id and root path from calibre).