nakkaya/static — pull request #18 by canassa (2013-10-06 00:55:54+00:00)
Title: Fixed RejectedExecutionException when watching files

Hi Nakkaya!

Thanks for writing this project. It so simple yet so useful :+1:

I had a problem when using the `--watch` option:

```
java -jar static-app.jar --watch
2013-10-05 20:16:10.369:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2013-10-05 20:16:10.386:INFO::jetty-6.1.x
2013-10-05 20:16:10.953:INFO::Started SocketConnector@0.0.0.0:8080
[+] INFO: Rebuilding site...
[+] INFO: Processing Public 0.0010 secs
[+] WARNING: Exception thrown while building site! java.util.concurrent.RejectedExecutionException
```

This `RejectedExecutionException` caused the the out-dir to not be generated. This problem only happened with `--watch`. The `--build` option worked fine and generated the build correctly.

I tracked down this problem to the `(shutdown-agents)` call. It seems that it was killing the watcher threads.

Canassa,