Very fast Job leaves behind two entries in progress viewer [message #328324] |
Wed, 21 May 2008 11:18  |
Eclipse User |
|
|
|
Hi there,
I have a curious problem here using Eclipse Jobs for background data
processing. If I have a job that finishes very very quickly (before I can
even see the modal progress/cancel dialog) and I set the Job's
IProgressConstants.KEEP_PROPERTY to true, then I end up with two (yes,
TWO) entries in the standard eclipse progress viewer. There should be only
one, though.
Having added a Thread.wait(500) at the beginning of my run() method, I see
the problem going away.
Have consulted this:
http://www.eclipse.org/articles/Article-Concurrency/jobs-api .html -- what
might I be missing?
Cheers,
Joerg
|
|
|
|
|
Re: Very fast Job leaves behind two entries in progress viewer [message #328485 is a reply to message #328423] |
Mon, 26 May 2008 09:44  |
Eclipse User |
|
|
|
Hi Felix and all,
Solved my problem. It was -- as in so many cases -- my fault.
From my Job object's run method I was (wrongly) returning a
Status.CANCEL_STATUS as a result of an internal error condition of my
business logic. So I guess Eclipse got confused because the user had not
cancelled the Job.
Have since changed it to return an object of my own status class
(implementing IStatus) and it now works just fine.
Cheers,
Joerg
|
|
|
Powered by
FUDForum. Page generated in 0.03390 seconds