baudehlo/deploy_to_runit — pull request #1 by dstibrany (2013-11-18 03:11:46+00:00)
Title: Add a queue to handle incoming deployment requests

I've ran into a problem where two deployment requests for two different repos came in around the same time.

Since `process.chdir` is being used before running commands on a repo, a situation can arise where we chdir into Repo2's directory while we are still processing Repo1. In my case, sv restart was run on Repo2 (twice) and never on Repo1.

My solution is to queue up requests, and dequeue when the current request is done (or process right away if the queue is empty).