New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New log detection #34
Comments
They used to be different, but now only onModified is needed. need to do some work on this class indeed. Statusbar shows latest file IF a message of it was processed, but that should be possible to do sooner. |
Make this This is double problem here. |
Made some of the changes in the 1.34 release. Should be stable enough for now, but will investigate this a bit more the coming days. Bit hard to really focus now after my 2nd vaccination. Main features are in now, so time for some refactoring and testing. |
Yes, np. Just saying that code has fundamental error. Because that will be doing random errors at random times, I explained why. In short - you can't use normal variables if it is accessed by 2+ threads. |
You're getting close, proper would be while (this.poll.getAndSet(pollEvents(watchService)); that will ensure if stop called prior pollEvents, it's false result will be noted. P.S. don't forget to revise all threads u do there (if any). P.P.S. They lowered Kit Flowler from 20 to 10 for unlock today. |
Yep, splitting into 2 vars was best solution. for (boolean poll = true;poll && this.run.get(); poll = pollEvents(watchService)) ; |
threading has been reworked |
...it does not detect new game started if this program was already running (or at least proper name is not shown in status bar). I think that is because ....look on log:
On time-stamps.
It is 4 seconds difference since 1st line and commander name happens in last line.
However, this handler will be called on 1st line - once new file created - at best case, and that complex IF will reject event.
The event " public void onModified(final FileEvent event)" seems the same, except it calls different handler...didn't dig there too much.
Also FileProcessor.processJournal must be called from 1 thread with current implementation. Theoretically if game will restart fast and new file will be detected while that thing is running - results will be weird. However not possible to make in practice, you can try to break things by copying log files to folder while program runs.
The text was updated successfully, but these errors were encountered: