diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index d7d2f9f..22429f3 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -63,7 +63,8 @@ class SitesController < ApplicationController authorize site # XXX: Convertir en una máquina de estados? - DeployJob.perform_async site.id if site.enqueue! + site.enqueue! + DeployJob.perform_async site.id redirect_to site_posts_path(site) end diff --git a/app/models/site.rb b/app/models/site.rb index 7aeb8a9..683541e 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -315,7 +315,7 @@ class Site < ApplicationRecord # Poner en la cola de compilación def enqueue! - waiting? && update(status: 'enqueued') + update(status: 'enqueued') if waiting? end # Está en la cola de compilación?