gitlabhq/gitlab-ci — pull request #142 by Deradon (2013-03-31 00:23:40+00:00)
Title: Try to make Runner.rb transactional safe

I noticed, that multiple Builds were triggered for one Project at the same time. (At time x, I got two Builds with status 'running')

After looking around in the Code, I assume that several Sidekiq::Jobs were called nearly at the same time (see Screenshot attached, all Jobs belong to the same Project).

This should not be a problem, but the code is not transactional (https://github.com/mperham/sidekiq/wiki/Best-Practices).

So I changed the part, that might becomes an issues when multiple Sidekiq::Jobs run in parallel.

![sidekiq_gitlab-ci](https://f.cloud.github.com/assets/385500/321155/5cd2bce4-9998-11e2-8f71-6fe585e62d4b.png)