Skip to content

[hook.rb]cache WebAPI instance #137

@ainoya

Description

@ainoya

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
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions