diff options
Diffstat (limited to 'app/jobs/govuk_guix/fetch_revision_job.rb')
-rw-r--r-- | app/jobs/govuk_guix/fetch_revision_job.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/jobs/govuk_guix/fetch_revision_job.rb b/app/jobs/govuk_guix/fetch_revision_job.rb index 6bec146..fd6e09c 100644 --- a/app/jobs/govuk_guix/fetch_revision_job.rb +++ b/app/jobs/govuk_guix/fetch_revision_job.rb @@ -51,11 +51,15 @@ class GovukGuix::FetchRevisionJob < Que::Job store_path = output.last.strip logger.debug(self.class) { "store_path: #{store_path}" } - GovukGuix::Revision.create( - commit_hash: sha, - store_path: store_path, - available_services: available_services(store_path, remote_host) - ) + GovukGuix::Revision.transaction do + GovukGuix::Revision.create( + commit_hash: sha, + store_path: store_path, + available_services: available_services(store_path, remote_host) + ) + + finish + end end def fetch_and_checkout(commit_hash, remote_host) |