Commit 0a280158 authored by Timothy Andrew's avatar Timothy Andrew Committed by Kamil Trzcinski

Eager load `lib/api`

- So that the server doesn't have to be restarted for every change in dev.
parent 5fc310b4
...@@ -79,6 +79,8 @@ module Gitlab ...@@ -79,6 +79,8 @@ module Gitlab
# This is needed for gitlab-shell # This is needed for gitlab-shell
ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH'] ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH']
config.eager_load_paths += ["#{Rails.root}/lib"]
config.generators do |g| config.generators do |g|
g.factory_girl false g.factory_girl false
end end
......
require 'sidekiq/web' require 'sidekiq/web'
require 'sidekiq/cron/web' require 'sidekiq/cron/web'
require 'api/api'
Rails.application.routes.draw do Rails.application.routes.draw do
if Gitlab::Sherlock.enabled? if Gitlab::Sherlock.enabled?
......
Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
module API module API
class API < Grape::API class API < Grape::API
include APIGuard include ::API::APIGuard
version 'v3', using: :path version 'v3', using: :path
rescue_from ActiveRecord::RecordNotFound do rescue_from ActiveRecord::RecordNotFound do
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/ci/api/*.rb"].each {|file| require file} ...@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/ci/api/*.rb"].each {|file| require file}
module Ci module Ci
module API module API
class API < Grape::API class API < Grape::API
include APIGuard include ::API::APIGuard
version 'v1', using: :path version 'v1', using: :path
rescue_from ActiveRecord::RecordNotFound do rescue_from ActiveRecord::RecordNotFound do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment