|
Replies:
22
-
Pages:
2
[
1
2
| Next
]
-
Last Post:
15 Jul 23, 00:43
Last Post By: RobM
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
textsToComments.groovy -> Crahs with lot of files/folders
Posted:
29 Jun 23, 18:27
|
|
|
Hi Rob,
recently I ran into trouble with this tool. 8 out of 10 times it crashs. Which means JA is not responding to anything, I had to kill it via the Windows task manager.
I think I found the error:
//Process all txt files if within the project
def processTextsFolder(AlbumObject txtFolder, Map txtDataMap, boolean recursive) {
for (AlbumObject ao : txtFolder.getChildren()) {
//if the text files are in a project ignore certain sub directories
if (ao.isFolder() && ao.isIncluded() && recursive) {
txtDataMap = processTxtFile(ao, ao, txtDataMap);
processTextsFolder(ao, txtDataMap, recursive);
}
else {
// !!MD MonitoredWorkQueue workQueue = new MonitoredWorkQueue(window, "Looking for txt/html files");
// !!MD workQueue.submit(() -> {
txtDataMap = processTxtFile(txtFolder, ao, txtDataMap);
// !!MD });
// !!MD if(workQueue.isAborted()) return txtDataMap;
// !!MD workQueue.awaitCompletion();
}
}
return txtDataMap;
}
By just commenting that MonitoredWorkQueue thing no crashs anymore and the processing is much faster.
Thanks, Markus
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
29 Jun 23, 18:52
in response to: RobM
|
|
|
|
|
Posts:
3,802
Registered:
4-Aug-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
29 Jun 23, 22:20
in response to: MarkusD
|
|
|
Sorry, it works every time for me. Can you try running the code below in the system console.
Just run it ten times (it will be quick). If it works, which I'm certain it will, then there is something strange going on with your project. If you can make a small project that shows this problem then post the project somewhere I can get it. I'll look at that and see if I can get it to do the same.
MonitoredWorkQueue workQueue = new MonitoredWorkQueue(window, "Looking for txt/html files");
workQueue.submit(() -> {
for (AlbumObject ao : window.albumExplorer.getRootFolder().getChildren()) {
System.out.println(ao);
}
System.out.println("Done OK");
});
if(workQueue.isAborted()) return false;
workQueue.awaitCompletion();
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
30 Jun 23, 21:48
in response to: RobM
|
|
|
Hi Rob,
the result:
1,039s ==> null
2023 10 28 Island
Contact.htt
Datenschutz.htt
res
Done OK
https://www.markus-drueck.de/JA/2023-06-30_213936.png
I also used:
window.albumExplorer.getCurrentFolder()
0,039s ==> null
Prolog
2023 10 28 Hahnst�tten - Hirtshals
2023 10 29 Hirtshals - T�rshavn
2023 10 30 T�rshavn
2023 10 31 T�rshavn - Sey�isfj�r�ur - M�vatn
2023 11 01 M�vatn - Varmahl��
2023 11 02 Varmahl�� - Reykjav�k
2023 11 03 Reykjav�k
2023 11 04 Reykjav�k
2023 11 05 Reykjav�k - V�k � M�rdal
2023 11 06 V�k � M�rdal - H�fn
2023 11 07 H�fn - Egilssta�ir
2023 11 08 Egilssta�ir - T�rshavn
2023 11 09 T�rshavn
2023 11 10 T�rshavn - Hirtshals
2023 11 11 Hirtshals
2023 11 12 Hirtshals - Hahnst�tten
More
Summary
Epilog
TextToSpeech
Done OK
The problem is, with small projects everything is fine. Problems start with albums which have already several hundred or thousand objects in folders or sub-sub-folders.
Thanks, Markus
|
|
|
Posts:
3,802
Registered:
4-Aug-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
30 Jun 23, 22:40
in response to: MarkusD
|
|
|
Ok, it sounds like things are getting out of sync. I’ll have another look, but it could be a few days and it might be beyond me. At least with it commented out it is working.
|
|
|
Posts:
3,802
Registered:
4-Aug-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
1 Jul 23, 21:27
in response to: RobM
|
|
Helpful |
|
|
Without making it overly complicated (for me, anyway) I decided to stick with your solution and just comment out the two instances of monitoredWorkQueue, when processing the directory containing the txt/html files.
I have now added progress information to the status bar, bottom left of jAlbum's window. That coupled with the remaining work queue and system console output should be enough to let the user (you) know things are working.
Updated tool
|
|
|
Posts:
8,194
Registered:
31-Jan-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
1 Jul 23, 21:32
in response to: RobM
|
|
|
You should make it like the progress indicator on a Windows update.
"You're 3% done.... 4%.... 5%," then about two minutes of nothing at all, then "98%... 99%... 100%" One is always convinced that the update has bricked the PC.
|
|
|
Posts:
3,802
Registered:
4-Aug-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
1 Jul 23, 22:23
in response to: JeffTucker
|
|
|
You should make it like the progress indicator on a Windows update.
"You're 3% done.... 4%.... 5%," then about two minutes of nothing at all, then "98%... 99%... 100%" One is always convinced that the update has bricked the PC.
I did consider a progress indicator that got to 98% and then stopped for 20 minutes, before saying 'completed'. Then it would feel like any OS update.
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
12 Jul 23, 21:13
in response to: RobM
|
|
|
Thanks Rob for your time and the update of the tool. I ran it a couple of times, with no errors at all and was lucky. Just to find out that the crashes occur again later. Nevertheless, I like that the progress windows is gone, because it was flickering during the process. Showing the processed objects in the JA looks much better.
I tried to compile a sample album so you would be able to reproduce the error, but had no luck to get a working sample right now.
|
|
|
Posts:
3,802
Registered:
4-Aug-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
12 Jul 23, 21:44
in response to: MarkusD
|
|
|
Try the attached, I think it should stop the error.
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
12 Jul 23, 21:53
in response to: RobM
|
|
|
Thanks Rob. But no, the script crashed again. My impression is, that the script itself finished very well, what is going wrong is the "refresh" of the JA GUI at the very end.
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
12 Jul 23, 22:04
in response to: RobM
|
|
|
|
|
Posts:
3,802
Registered:
4-Aug-2006
|
|
|
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted:
12 Jul 23, 22:52
in response to: MarkusD
|
|
|
Can you open the System console before running the tool, and make sure it is visible. When jAlbum stops responding what is shown in the console?
If there is a dump file created can you post that (David would have to look at it to interpret it though).
The only other thing I can think of trying is excluding folders, say half, and see if it works. If not exclude more, if it works add more until it breaks. Then see if there is anything specific in that folder.
I don't have large projects, if I had an idea of how many folders/files are needed to cause the problem I can make up a project.
|
|
|
Posts:
606
Registered:
13-Apr-2006
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|