Skip to content

Commit

Permalink
Finally tracked down the memory leak. Lots of new skillz gained along…
Browse files Browse the repository at this point in the history
… the way.
  • Loading branch information
ryanstout committed Sep 18, 2015
1 parent facdaee commit 61d4708
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
12 changes: 0 additions & 12 deletions lib/volt/server/rack/index_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ def initialize(rack_app, volt_app, component_paths, opal_files)
@opal_files = opal_files

@@router = volt_app.router

@@router.define do
# Load routes for each component
component_paths.components.values.flatten.uniq.each do |component_path|
routes_path = "#{component_path}/config/routes.rb"

if File.exist?(routes_path)
route_file = File.read(routes_path)
instance_eval(route_file, routes_path, 0)
end
end
end
end

def route_match?(path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ def self.call(input)
data = env.read_file(input[:filename], input[:content_type])
end

dependencies = Set.new(input[:metadata][:dependencies])
dependencies += [env.build_file_digest_uri(input[:filename])]
# dependencies = Set.new(input[:metadata][:dependencies])
# dependencies += [env.build_file_digest_uri(input[:filename])]

dependencies = input[:metadata][:dependencies]
# dependencies.merge(env.build_file_digest_uri(input[:filename]))

{ data: data, dependencies: dependencies }
end
Expand Down
3 changes: 2 additions & 1 deletion lib/volt/tasks/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def self.known_handlers

# Set the timeout for method calls on this task. (The default is
# Volt.config.worker_timeout)
def timeout(value)
# Set 0 to disable timeout
def self.timeout(value)
self.__timeout = value
end

Expand Down
2 changes: 2 additions & 0 deletions lib/volt/volt/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def initialize(app_path=nil)
# Setup the middleware that we can only setup after all components boot.
setup_postboot_middleware

setup_routes

start_message_bus
end
end
Expand Down
16 changes: 16 additions & 0 deletions lib/volt/volt/server_setup/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ def setup_router
@router = Routes.new
end

def setup_routes
component_paths = @component_paths
@router.define do
# Load routes for each component
component_paths.components.values.flatten.uniq.each do |component_path|
routes_path = "#{component_path}/config/routes.rb"

if File.exist?(routes_path)
route_file = File.read(routes_path)
instance_eval(route_file, routes_path, 0)
end
end
end

end

def setup_preboot_middleware
@middleware = MiddlewareStack.new
DefaultMiddlewareStack.preboot_setup(self, @middleware)
Expand Down

0 comments on commit 61d4708

Please sign in to comment.