summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 17:18:23 +0300
committerWolfy-J <[email protected]>2018-06-10 17:18:23 +0300
commit094a4c211022b9446ef988c74c546ad6efb09722 (patch)
tree603ade627491960108154d6301868c9b881cd101 /cmd
parent232aa8f3c20a060e556ab431467f4f7b3f83bfbf (diff)
http service
Diffstat (limited to 'cmd')
-rw-r--r--cmd/rr/.rr.yaml63
-rw-r--r--cmd/rr/cmd/serve.go9
2 files changed, 33 insertions, 39 deletions
diff --git a/cmd/rr/.rr.yaml b/cmd/rr/.rr.yaml
index 5ccf73e9..b7da7fac 100644
--- a/cmd/rr/.rr.yaml
+++ b/cmd/rr/.rr.yaml
@@ -9,59 +9,50 @@ rpc:
# http service configuration.
http:
# set to false to disable http server.
- enabled: true
+ enable: true
# http host to listen.
- host: 0.0.0.0
+ address: 0.0.0.0:8080
- # http port.
- port: 8080
-
- # max POST request size, including file uploads.
- maxRequest: 1G
-
- # static file serving.
- static:
- # when true rr http will be serving static files.
- serve: true
-
- # root directory for static file (http would not serve .php and .htacess files).
- root: "/Users/wolfy-j/Projects/phpapp/webroot"
+ # max POST request size, including file uploads. (default: 1GB)
+ maxRequest: 1073741824
# file upload configuration.
uploads:
- # directory to store uploaded files before passing to PHP, keep empty to use default system
- # temp directory.
- tmpDir:
-
# list of file extensions which are forbidden for uploading.
forbid: [".php", ".exe", ".bat"]
# http worker pool configuration.
- pool:
+ workers:
# php worker command.
command: "php /Users/wolfy-j/Projects/phpapp/webroot/index.php rr pipes --no-ansi"
- user: "wolfy-j"
-
- group: "wolfy-j"
-
# connection method (pipes, tcp://:9000, unix://socket.unix).
relay: "pipes"
- # number of active workers.
- number: 1
+ # worker pool configuration.
+ pool:
+ # number of workers to be serving.
+ numWorkers: 1
+
+ # maximum jobs per worker, 0 - unlimited.
+ maxJobs: 0
+
+ # worker allocation timeouts.
+ timeouts:
+ # for how long worker is allowed to be bootstrapped.
+ allocateTimeout: 6000000
- # maximum jobs per worker, 0 - unlimited.
- maxJobs: 0
+ # amount of time given to worker to gracefully destruct itself.
+ destroyTimeout: 6000000
- # worker allocation timeouts.
- timeouts:
- # for how long socket based relay should await worker connection.
- connect: 10
+# static file serving.
+static:
+ # serve http static files
+ enable: true
- # for how long worker is allowed to be bootstrapped.
- allocate: 60
+ # root directory for static file (http would not serve .php and .htacess files).
+ dir: "/Users/wolfy-j/Projects/phpapp/webroot"
- # amount of time given to worker to gracefully destruct itself.
- destroy: 60 \ No newline at end of file
+ # list of extensions for forbid for serving.
+ forbid: [".php", ".htaccess"] \ No newline at end of file
diff --git a/cmd/rr/cmd/serve.go b/cmd/rr/cmd/serve.go
index ffa283d3..b04ea4b7 100644
--- a/cmd/rr/cmd/serve.go
+++ b/cmd/rr/cmd/serve.go
@@ -33,14 +33,17 @@ func init() {
CLI.AddCommand(&cobra.Command{
Use: "serve",
Short: "Serve RoadRunner service(s)",
- Run: serveHandler,
+ RunE: serveHandler,
})
signal.Notify(stopSignal, syscall.SIGTERM)
}
-func serveHandler(cmd *cobra.Command, args []string) {
- Container.Serve()
+func serveHandler(cmd *cobra.Command, args []string) error {
+ if err := Container.Serve(); err != nil {
+ return err
+ }
+
<-stopSignal
Container.Stop()
}