summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 17:53:13 +0300
committerWolfy-J <[email protected]>2018-06-10 17:53:13 +0300
commit4fd4c7a1e8194287249fa59252afc2cd260d5643 (patch)
tree7f2f3872ff13ff063acca14d4294b4d299c3dea2 /cmd
parent094a4c211022b9446ef988c74c546ad6efb09722 (diff)
rr is working now
Diffstat (limited to 'cmd')
-rw-r--r--cmd/rr/.rr.yaml18
-rw-r--r--cmd/rr/cmd/root.go5
-rw-r--r--cmd/rr/cmd/serve.go2
-rw-r--r--cmd/rr/main.go6
4 files changed, 16 insertions, 15 deletions
diff --git a/cmd/rr/.rr.yaml b/cmd/rr/.rr.yaml
index b7da7fac..34475da7 100644
--- a/cmd/rr/.rr.yaml
+++ b/cmd/rr/.rr.yaml
@@ -25,7 +25,7 @@ http:
# http worker pool configuration.
workers:
# php worker command.
- command: "php /Users/wolfy-j/Projects/phpapp/webroot/index.php rr pipes --no-ansi"
+ command: "php c:/GoProj/phpapp/webroot/index.php rr pipes --no-ansi"
# connection method (pipes, tcp://:9000, unix://socket.unix).
relay: "pipes"
@@ -33,26 +33,24 @@ http:
# worker pool configuration.
pool:
# number of workers to be serving.
- numWorkers: 1
+ numWorkers: 2
# maximum jobs per worker, 0 - unlimited.
maxJobs: 0
- # worker allocation timeouts.
- timeouts:
- # for how long worker is allowed to be bootstrapped.
- allocateTimeout: 6000000
+ # for how long worker is allowed to be bootstrapped.
+ allocateTimeout: 6000000
- # amount of time given to worker to gracefully destruct itself.
- destroyTimeout: 6000000
+ # amount of time given to worker to gracefully destruct itself.
+ destroyTimeout: 6000000
# static file serving.
static:
# serve http static files
enable: true
- # root directory for static file (http would not serve .php and .htacess files).
- dir: "/Users/wolfy-j/Projects/phpapp/webroot"
+ # root directory for static file (http would not serve .php and .htaccess files).
+ dir: "c:/GoProj/phpapp/webroot"
# list of extensions for forbid for serving.
forbid: [".php", ".htaccess"] \ No newline at end of file
diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go
index ca83164e..ea7c8a3b 100644
--- a/cmd/rr/cmd/root.go
+++ b/cmd/rr/cmd/root.go
@@ -53,7 +53,7 @@ var (
// This is called by main.main(). It only needs to happen once to the CLI.
func Execute() {
if err := CLI.Execute(); err != nil {
- utils.Printf("Error: <red>%s</reset>\n", err)
+ utils.Printf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
os.Exit(1)
}
}
@@ -69,7 +69,8 @@ func init() {
if cfg := initConfig(cfgFile, []string{"."}, ".rr"); cfg != nil {
if err := Container.Configure(cfg); err != nil {
- panic(err)
+ utils.Printf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
+ os.Exit(1)
}
}
})
diff --git a/cmd/rr/cmd/serve.go b/cmd/rr/cmd/serve.go
index b04ea4b7..334771ae 100644
--- a/cmd/rr/cmd/serve.go
+++ b/cmd/rr/cmd/serve.go
@@ -46,4 +46,6 @@ func serveHandler(cmd *cobra.Command, args []string) error {
<-stopSignal
Container.Stop()
+
+ return nil
}
diff --git a/cmd/rr/main.go b/cmd/rr/main.go
index 3d15924b..ed47b2ed 100644
--- a/cmd/rr/main.go
+++ b/cmd/rr/main.go
@@ -36,13 +36,13 @@ import (
func main() {
// provides ability to make local connection to services
- rr.Container.Register(rpc.Name, new(rpc.Service))
+ rr.Container.Register(rpc.Name, &rpc.Service{})
// http serving
- rr.Container.Register(http.Name, new(http.Service))
+ rr.Container.Register(http.Name, &http.Service{})
// serving static files
- rr.Container.Register(static.Name, new(static.Service))
+ rr.Container.Register(static.Name, &static.Service{})
// you can register additional commands using cmd.CLI
rr.Execute()