summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-05-29 13:17:03 +0300
committerWolfy-J <[email protected]>2018-05-29 13:17:03 +0300
commitfd95f32812f4b8f932225ed273b0109f9514ec91 (patch)
tree9161c57422aca911d5bc81e1b5bddee694e5d9a1
parentebef51e570fbb1d8761275b44bbdbf2ea4dd33a6 (diff)
fixing tests
-rw-r--r--cmd/rr-php/cmd/serve.go10
-rw-r--r--router.go4
2 files changed, 12 insertions, 2 deletions
diff --git a/cmd/rr-php/cmd/serve.go b/cmd/rr-php/cmd/serve.go
index 9540a986..cac830ac 100644
--- a/cmd/rr-php/cmd/serve.go
+++ b/cmd/rr-php/cmd/serve.go
@@ -20,6 +20,7 @@ import (
"os/exec"
"log"
"time"
+ "github.com/sirupsen/logrus"
)
func init() {
@@ -43,9 +44,18 @@ func serveHandler(cmd *cobra.Command, args []string) {
DestroyTimeout: time.Minute,
})
+ r.Observe(func(event int, ctx interface{}) {
+ logrus.Info(ctx)
+ })
+
if err != nil {
panic(err)
}
+ for i := 0; i < 10; i++ {
+ r.Exec(&roadrunner.Payload{})
+ }
+
log.Print(r.Workers())
+
}
diff --git a/router.go b/router.go
index dffa0e88..4635517d 100644
--- a/router.go
+++ b/router.go
@@ -3,7 +3,7 @@ package roadrunner
import (
"sync"
"os/exec"
- "github.com/go-errors/errors"
+ "fmt"
)
const (
@@ -85,7 +85,7 @@ func (r *Router) Pool() (Pool, error) {
defer r.mu.Unlock()
if r.pool == nil {
- return nil, errors.New("no associated pool")
+ return nil, fmt.Errorf("no associated pool")
}
return r.pool, nil