Do not force loading the functions
Here we're forcing loading everything: https://gitlab.com/gitlab-org/serverless/runtimes/ruby/-/blob/master/runtime/lib/function/loader.rb
module Function
class Loader
def self.load!
Dir['/functions/**/*.rb'].each { |f| load(f) }
yield if block_given?
end
end
end
This confused me so much because my files were loaded multiple times. Can we allow the users to manage this? This makes handling dependencies difficult.
Even if we want to load the functions automatically, it should probably in a fixed ordering, and with require_relative
but not load
.
/cc @grzesiek
Edited by Lin Jen-Shin