From f22db22110d8362ec1518d97716b169a55f9c300 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Thu, 25 Nov 2021 23:57:07 +0100 Subject: [PATCH] Enable Poseidon sync after commit --- app/models/execution_environment.rb | 1 + spec/db/seeds_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/execution_environment.rb b/app/models/execution_environment.rb index 2f16db6b..d6e0b5b6 100644 --- a/app/models/execution_environment.rb +++ b/app/models/execution_environment.rb @@ -36,6 +36,7 @@ class ExecutionEnvironment < ApplicationRecord after_destroy :delete_runner_environment after_save :working_docker_image?, if: :validate_docker_image? + after_update_commit :sync_runner_environment, unless: proc {|_| Rails.env.test? } after_rollback :delete_runner_environment, on: :create after_rollback :sync_runner_environment, on: %i[update destroy] diff --git a/spec/db/seeds_spec.rb b/spec/db/seeds_spec.rb index 07ab8e4f..71cb7274 100644 --- a/spec/db/seeds_spec.rb +++ b/spec/db/seeds_spec.rb @@ -17,6 +17,7 @@ describe 'seeds' do ActiveRecord::Base.establish_connection(:test) } allow_any_instance_of(ExecutionEnvironment).to receive(:working_docker_image?).and_return true + allow_any_instance_of(ExecutionEnvironment).to receive(:sync_runner_environment).and_return true end describe 'execute db:seed', cleaning_strategy: :truncation do