flynn/flynn-controller — pull request #21 by lmars (2014-05-30 12:16:58+00:00)
Title: Only remove jobs from the scheduler once they actually stop

Previously when scaling down a formation, the job would be removed from the scheduler's known jobs during the formation's rectify routine, which would mean once the job actually stops and a stop event is emitted, the scheduler doesn't recognize the job id (see [here](https://github.com/flynn/flynn-controller/blob/master/scheduler/main.go#L227)) and so does not change it's state in the controller.

With this change, the job is only removed from the known jobs once it has actually stopped (i.e. once a stop event has been received from the host).