ccw-ide / ccw

Counterclockwise is an Eclipse plugin helping developers write Clojure code
https://github.com/laurentpetit/ccw/wiki/GoogleCodeHome
Eclipse Public License 1.0
220 stars 50 forks source link

Update dependencies should never run concurrently #818

Closed arichiardi closed 9 years ago

arichiardi commented 9 years ago

Here is the fix, with the tests is more consistent, but i was able to just tear the commit to pieces :wink:

feat(leiningen): isolate update dependencies execution and added cancelability

The patch introduces two features. The first disallow the possibility to run concurrent dependency
updates. An atom has been added in ccw.leiningen.classpath-container in order to control this.
The second is WorkspaceJob cancel support: the implementation can be polished with macros but at the
moment functions are passed around (especially in get-project-dependencies) in order to throw
OperationCancelledException in the appropriate place and a new cancelable-workspace-job has been
added in ccw.eclipse.

The cancel response is not immediate as only get-project-dependencies has been harnessed with
breaking capabilities.
arichiardi commented 9 years ago

It failes because of an addition SmokeTests I did in the other PR

laurentpetit commented 9 years ago

OK, so I managed to identify the code that was doing things unnecessarily. I think I have tested all the other paths that could have been affected by my change, and that I've not introduced a regression. The fix is in commit https://github.com/laurentpetit/ccw/commit/b5647322a09181d01ddfc90c1d7e14ad8ad452cc

laurentpetit commented 9 years ago

I will close this PR, then.

arichiardi commented 9 years ago

:+1:

arichiardi commented 9 years ago

By the way, if you want I can test some behavior (like update dependencies)...something that you've noticed should happen on the ui...for example I have noticed a lot of nested WorkspaceJob and wondered if I should see them all as dialogs..