View Single Post
  #732  
Old 30.05.2019, 16:38
bobolecoco bobolecoco is offline
Super Loader
 
Join Date: Aug 2015
Location: France
Posts: 27
Default Wait / Sleep

Hi.
The trigger is "A download started".
With the following code, downloads are "freezed" :
Code:
function Stream() {
    if (isDownloadControllerRunning()) {
        alert("OK !");
        sleep(30000);
        Stream();
    }
}
Stream();
Why ? Is the "sleep" function is "sleeping" the whole JDownloader process or just the script ?

(This is for testing purpose, my idea is to replace "alert("OK !");" with a function I want to check every 30 seconds while the "Download Controller" is running).

Is there a way to achieve that (pausing only the script) ?

Thanks !

Last edited by bobolecoco; 30.05.2019 at 16:56.
Reply With Quote