From c34e4a081440d2164e46d370b129f11a7b14f563 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 26 Jul 2017 13:31:36 +0200 Subject: [PATCH 1/2] fix background worker bug --- app/models/asset.rb | 2 +- config/environments/development.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/asset.rb b/app/models/asset.rb index 7430bc473..7d3eb30b3 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -472,7 +472,7 @@ class Asset < ApplicationRecord if errors.size > 1 temp_errors = errors[:file] errors.clear - errors.set(:file, temp_errors) + errors.add(:file, temp_errors) end end diff --git a/config/environments/development.rb b/config/environments/development.rb index ad2246fa1..e4d01050d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -4,10 +4,10 @@ Rails.application.configure do # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.cache_classes = true # Do not eager load code on boot. - config.eager_load = false + config.eager_load = true # Show full error reports and disable caching. config.consider_all_requests_local = true From afa05c8c1407cde16b2c394b64ec3195b62f64ad Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 23 Aug 2017 17:10:45 +0200 Subject: [PATCH 2/2] fixed background worker in dev env --- Makefile | 2 +- config/environments/development.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bc41aaeee..cc886509b 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ stop: @docker-compose stop worker: - @$(MAKE) rails cmd="rake jobs:work" + @$(MAKE) rails cmd="rake jobs:work export WORKER=1" cli: @$(MAKE) rails cmd="/bin/bash" diff --git a/config/environments/development.rb b/config/environments/development.rb index e4d01050d..e8cf8a048 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -4,10 +4,10 @@ Rails.application.configure do # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = true + config.cache_classes = ENV['WORKER'] ? true : false # Do not eager load code on boot. - config.eager_load = true + config.eager_load = ENV['WORKER'] ? true : false # Show full error reports and disable caching. config.consider_all_requests_local = true