OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/config/environments/development.rb

87 lines
3.1 KiB

#-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++
OpenProject::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# 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
# Automatically refresh translations with I18n middleware
config.middleware.use ::I18n::JS::Middleware
# Do not eager load code on boot.
config.eager_load = false
Reactivate event base file checkers This reverts commit f920cc73a04cd61b6e29519be18ae5ab29c02309. We originally removed event base file checking to cope with problems on os x that would lead to having a multitude of fsevent_watch processes (one for every directory) and those processes would sometimes, e. g. when the system was sent to standby turn zombie. If not killed dutifully by the developer, the system would become unresponsive as the maximum number of processes as dictated by the os would be reached. Not even killing processes would be possible any more as kill requires forking. Now the listen gem was released as version 3.2.1 which changed to only needing one process to watch all directories. As event based dirty checking promises to be more performant than checking all the files, and the reload time in dev mode would exceed tens of seconds if kept running for a longer period of time, I took another stab at integrating the listen gem again: The good: * The file checking seems to work. Altering the code is reflected by the application. * Only two fsevent_watch processes are created (one for the code files and one for the locales.) * The fsevent_watch processes where exited as desired when the rails process was existed. I did not yet test it for an extended amount of time but this also seems to hold true when the system was suspended in the meantime. The bad: * Subjectively, reloading did not seem to be faster. However, I did not leave the server running over an extended period of changes. So the event based detection might shine in the long run. The ugly: * When running multitreaded, the server seems to be running into deadlocks. I assume, that there is a shared, but mutexed, resource multiple threads attempt to access at the same time. It does not happen on every page but one of the roadmap pages on my development env causes the problem consistently. The problem can be circumvented by disabling multi treading: `RAILS_MIN_THREADS=1 RAILS_MAX_THREADS=1 bundle exec rails s` The same problem does not occur when running the server with multiple worker processes: `OPENPROJECT_WEB_WORKERS=4 RAILS_MIN_THREADS=1 RAILS_MAX_THREADS=1 bundle exec rails s`
5 years ago
# Asynchronous file watcher
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = :local
# Show full error reports
config.consider_all_requests_local = true
# Enable caching in development
config.action_controller.perform_caching = true
# Don't perform caching for Action Mailer in development
config.action_mailer.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
# Disable compression and asset digests, but disable debug
config.assets.debug = false
config.assets.digest = false
# Suppress asset output
config.assets.quiet = true unless config.log_level == :debug
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Send mails to browser window
config.action_mailer.delivery_method = :letter_opener
end
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT) unless String(ENV["SILENCE_SQL_LOGS"]).to_bool