View Single Post
Old 04-16-2016, 03:58 AM   #10
whismerhill
Connoisseur
whismerhill began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Apr 2016
Device: Kindle 4(mine) & Kindle Touch(wife)
Quote:
Originally Posted by kovidgoyal View Post
If you are saying that calibre should have an option to prevent the computer from sleeping while jobs are running, as opposed to doing it unconditionally, I have no objection to that, but I also dont think it is worth the time to implement it myself. Patches are welcome.
Fair enough. I suppose my first post wasn't clear enough to convey the idea of an option

Quote:
Originally Posted by BetterRed View Post
An alternative might be to provide a feature that would tell calibre send a shut down/sleep message to the OS when its batch jobs are done, before it terminates itself. A 'do once' button in the Alt_Shift+J Jobs would do the trick. That way any non calibre tasks scheduled to run on logoff, sleep (?), or shutdown -- like backup -- get done.

I prefer solutions that put the onus on the user to do something "now", rather than relying on (or getting bitten by) some previously set and long forgotten option.

BR
Actually no, what you suggest is completely the reverse from what I was suggesting.
In your case, sleep needs to be disabled globally so that the computer would stay awake, then calibre sends a sleep message at the end of tasks.
Doable but inefficient as other applications might interfere with the sleep message or even also require the computer to stay awake

it's much much more efficient to setup your own computer for sleep, and have the application temporarily suppress the default sleep behavior
see this blog for more details : https://dlaa.me/blog/post/9901642
or even this microsoft article which also has nice remarks about the function used to prevent sleep : https://msdn.microsoft.com/en-us/lib...8VS.85%29.aspx

Last edited by whismerhill; 04-16-2016 at 04:08 AM.
whismerhill is offline   Reply With Quote