JDownloader Community - Appwork GmbH
 

Go Back   JDownloader Community - Appwork GmbH > English Support > General Discussion
Reply
 
Thread Tools Display Modes
  #1  
Old 16.08.2011, 14:33
whismerhill
Guest
 
Posts: n/a
Post JD & OS shutdown (script added)

JD won't always correctly save the download list state when shutting down the computer directly
(whether a file is finished or not)

consequence : if one forgets to close JD before shutting down the computer, then on next JD startup some downloads will be considered as not finished whereas the files are full & complete, therefore JD will ask to redownload or ignore those...


suggestion : periodic saves of the "download list state" would also be good against OS wide crashes (just in case something else makes the computer crash)

suggestion : implementing a save of the "download list state" upon external close command should also be an option as far as my knowledge goes...

Thanks for reading.

Last edited by whismerhill; 17.08.2011 at 23:18.
Reply With Quote
  #2  
Old 16.08.2011, 14:41
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,614
Default

periodic saves already take place, though I'm unaware of the frequency of this process. JD might need better system shutdown signal detection, which should (quick/force) stop/halt downloads then saves rather than continuing downloading until the OS terminates pid as you will always have a chance of unsaved data (config and even download file(s) to disk).

While system just crashing you cant do much about as no warnings are given..
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #3  
Old 16.08.2011, 14:51
whismerhill
Guest
 
Posts: n/a
Default

then periodic saves are sometimes either very ineffective, or broken on my computer

because as it happens I had the case where I downloaded some files in a group (about 22 /40 I think) on day 1

on day 2 I start JD & JD continues with file 23
on day 2 JD finishes all 40 downloads
(I don't remember if there's something else to download after that, I think there was nothing else but I'm not totally sure)
on day 3 I start JD & it asks whether to ignore or redownload file 23 ...

and this is not an isolated issue either, it already happened before & will happen again as long as I sometimes forget to shut it down separatly.
Reply With Quote
  #4  
Old 16.08.2011, 18:42
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,614
Default

Maybe setup JD differently if you want a work around ?
look at the addon 'shutdown', this can shut your system down after your queue is finished.

Also look at the 'scheduler', you can set stop marks / shutdown based on time over waiting for the queue to finish.

This will give you better control over this issue for now waiting for permanent/better solution.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #5  
Old 17.08.2011, 00:44
whismerhill
Guest
 
Posts: n/a
Default

thanks
I already use that & this is not the same case
in those case JD shutdowns the computer by itself once it's done

in my case I shutdown/restart the computer now & I just forgot JD was still running (end of day, going to sleep mainly ...)


appreciate the help, I was just reporting this, because it's been a lot of versions already that this problem persist, and I just thought that maybe it's not present in the buglist

Last edited by whismerhill; 17.08.2011 at 00:47.
Reply With Quote
  #6  
Old 17.08.2011, 01:06
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,614
Default

Sure your welcome, was thinking out loud.

maybe jiaz will comment when he comes into work ;]
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #7  
Old 17.08.2011, 08:39
remi
Guest
 
Posts: n/a
Default

@whismerhill

When I shut down my computer I look at the the task bar of Windoze. I'll not shut it down as long as there are running tasks.

jD saves its link status every 10 minutes. A file that can't be resumed will start downloading again.
Reply With Quote
  #8  
Old 17.08.2011, 10:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,571
Default

you have to close jd before shutting computer down
windows does not *safely* shutdown java, its more a *now or die* solution.
jdownloader is not informed to shutdown and so you might loose your database.

until we found a nice solution to this, its better to close jd manually before shutdown
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 17.08.2011, 16:39
whismerhill
Guest
 
Posts: n/a
Default

I see
well thanks for the information
do you think it would be possible as a workaround to setup a system wide shutdown script to close jd manually ? (or maybe log off script instead of shutdown)

PS : I know how to setup a script & how to do a bat and/or autohotkey file

Last edited by whismerhill; 17.08.2011 at 17:11.
Reply With Quote
  #10  
Old 17.08.2011, 19:10
whismerhill
Guest
 
Posts: n/a
Default

more precise question :
would such a "winclose" command **External links are only visible to Support Staff****External links are only visible to Support Staff** work ok for the purpose of saving the database if sent to JD ?

thanks.


edit: I ask this question because of the following comment in the command notes :
"WinClose sends a WM_CLOSE message to the target window, which is a somewhat forceful method of closing it"
so I'm not quite sure that JD would save its data if closed in this way

Last edited by whismerhill; 17.08.2011 at 19:13.
Reply With Quote
  #11  
Old 17.08.2011, 22:48
whismerhill
Guest
 
Posts: n/a
Thumbs up

I did a working script to close JD
& according to my testing it should close JD normally which relates in saving the database

Deleting a link or adding a link or finishing to download a link & immediately running the script always saves the database before closing. but I may have missed something
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 3	; exact title match mode

; This script will close ALL windows named exactly "JDownloader"
; (which should in theory relate only to JDownloader itself, however some folders could match. Eitherway this being a shutdown script it shouldn't have any serious impact)
; This script requires that JDownloader has the "Close to tray" option DISABLED or else it won't work
; This script also requires that JDownloader "are you sure you want to quit" does NOT show
; (because then the "WM_CLOSE" command will only result in sending JDownloader to the notification bar)

Loop, 100
{
	IfWinExist, JDownloader
	{
		WinClose
	}
	Else
	{
		Break
	}
	sleep 10
}
ExitApp
edit: added this script to shutdown process, I'll report back in a couple of weeks

Last edited by whismerhill; 17.08.2011 at 23:32.
Reply With Quote
  #12  
Old 18.08.2011, 08:45
remi
Guest
 
Posts: n/a
Default

If you aren't able to close jD manually, you can use jD's remote control interface. You can close jD with the action "**External links are only visible to Support Staff**. With "**External links are only visible to Support Staff** you can stop de downloads.
Reply With Quote
  #13  
Old 10.09.2011, 15:10
whismerhill
Guest
 
Posts: n/a
Default

I said I'll report back in a couple of weeks
so here it is : this works, the database seems to always save correctly with this in place. at least I had no further problems with database not saving when I do not close JD before shutting down the computer (which saves some clicks always a good thing...)


sidenotes: thanks remi
I'm not sure how I can execute a localnet link without launching a browser window though.(which can be annoying due to saved browser sessions) I will explore this as this is superior to a simple winclose command because it needs no change to the "Close to tray" setting. As it is, it already works though so there's absolutely no hurry.
Reply With Quote
  #14  
Old 11.09.2011, 09:26
remi
Guest
 
Posts: n/a
Default

If you don't want to juggle with the sessions of your default browser I would just install another (small) browser and let it connect to the URI. I suppose each browser has these commands but I'm not sure.
Reply With Quote
  #15  
Old 12.09.2011, 14:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,571
Default

@whismerhill
thanks for feedback
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 19:07.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.