pool icon indicating copy to clipboard operation
pool copied to clipboard

[hook.rb]cache WebAPI instance

Open ainoya opened this issue 11 years ago • 0 comments

Improve the speed of processing request in hook.rb For example,

docker/pool/provisioning/mruby.conf:

<IfModule mruby_module>
  ProxyPreserveHost On
  mrubyChildInitMiddle "/app/handlers/init.rb"
  mrubyTranslateNameMiddle "/app/handlers/hook.rb"
</IfModule>

docker/pool/handler/init.rb:

Userdata.new("api").git_api = WebAPI.new("http://0.0.0.0:9000")
Userdata.new("api").docker_api = WebAPI.new("http://0.0.0.0:9002")

docker/pool/handler/hook.rb:

...
# To request and control git repository inside pool, init the api client
# Git repository handler(GitHandler) listens on "http://0.0.0.0:9000"
git_api = Userdata.new("api").git_api
...

ainoya avatar Jan 20 '15 14:01 ainoya