autoshutdown icon indicating copy to clipboard operation
autoshutdown copied to clipboard

Delay before shutdown

Open cas-- opened this issue 10 years ago • 2 comments

From: Pluto Crat [email protected]

A small delay before shutdown would be good, perhaps configurable by the preferences page too. "Delay xx seconds". The reason for this is often when the plugin triggers there is still a small amount of data to download. When I unsuspend / restart the computer Deluge still needs a few seconds to get the rest of the file. If I don't allow it to do this, the file is corrupted and useless.

cas-- avatar May 20 '15 09:05 cas--

Hi, just had another thought about this. Basically I think your code initiates shutdown/suspend when the torrent status turns from downloading to seeding. However at this point, there is still data being retrieved. Maybe if you triggered it when status=seeding AND download speed=0, that would be better, and the full file would be retrieved before shutdown triggers.

plutocrat avatar Jul 10 '16 02:07 plutocrat

I suspect that the data has not been flushed to disk so could try flush_cache and wait for cache_flushed_alert before calling shutdown method.

It might be worth asking the libtorrent dev whether we should expect the data to have been flushed to disk upon receiving a torrent_finished_alert.

cas-- avatar Jul 10 '16 10:07 cas--