summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-10-26 11:50:12 +0300
committerValery Piashchynski <[email protected]>2020-10-26 11:50:12 +0300
commit9aae9e2009bad07ebdee73e1c6cf56901d07880a (patch)
tree0ad9537bd438c63719fb83343ab77fc4ab34eb83 /plugins
parentdb7695463e85faf3fba6a2767b2dfa6ef916785d (diff)
Fix linters warnings
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/config/tests/config_test.go2
-rwxr-xr-xplugins/factory/app.go9
-rwxr-xr-xplugins/factory/tests/plugin_1.go2
-rwxr-xr-xplugins/factory/tests/plugin_2.go20
-rwxr-xr-xplugins/rpc/rpc.go3
-rwxr-xr-xplugins/rpc/rpc_test.go1
6 files changed, 19 insertions, 18 deletions
diff --git a/plugins/config/tests/config_test.go b/plugins/config/tests/config_test.go
index c85a841f..14e60ac2 100755
--- a/plugins/config/tests/config_test.go
+++ b/plugins/config/tests/config_test.go
@@ -48,7 +48,7 @@ func TestViperProvider_Init(t *testing.T) {
for {
select {
case e := <-errCh:
- assert.NoError(t, e.Error.Err)
+ assert.NoError(t, e.Error)
assert.NoError(t, container.Stop())
return
case <-c:
diff --git a/plugins/factory/app.go b/plugins/factory/app.go
index 62da4f53..4951e3df 100755
--- a/plugins/factory/app.go
+++ b/plugins/factory/app.go
@@ -3,15 +3,16 @@ package factory
import (
"context"
"fmt"
+ "log"
+ "os"
+ "os/exec"
+ "strings"
+
"github.com/fatih/color"
"github.com/spiral/endure/errors"
"github.com/spiral/roadrunner/v2"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/util"
- "log"
- "os"
- "os/exec"
- "strings"
)
const ServiceName = "app"
diff --git a/plugins/factory/tests/plugin_1.go b/plugins/factory/tests/plugin_1.go
index df632481..9011bb00 100755
--- a/plugins/factory/tests/plugin_1.go
+++ b/plugins/factory/tests/plugin_1.go
@@ -29,7 +29,7 @@ func (f *Foo) Serve() chan error {
return errCh
}
- cmd, err := f.spawner.CommandFactory(nil)
+ cmd, err := f.spawner.NewCmdFactory(nil)
if err != nil {
errCh <- err
return errCh
diff --git a/plugins/factory/tests/plugin_2.go b/plugins/factory/tests/plugin_2.go
index dbdb065b..9f401bec 100755
--- a/plugins/factory/tests/plugin_2.go
+++ b/plugins/factory/tests/plugin_2.go
@@ -14,13 +14,11 @@ import (
type Foo2 struct {
configProvider config.Provider
wf factory.AppFactory
- spw factory.Spawner
}
-func (f *Foo2) Init(p config.Provider, workerFactory factory.AppFactory, spawner factory.Spawner) error {
+func (f *Foo2) Init(p config.Provider, workerFactory factory.AppFactory) error {
f.configProvider = p
f.wf = workerFactory
- f.spw = spawner
return nil
}
@@ -34,7 +32,7 @@ func (f *Foo2) Serve() chan error {
return errCh
}
- cmd, err := f.spw.CommandFactory(nil)
+ cmd, err := f.wf.NewCmdFactory(nil)
if err != nil {
errCh <- err
return errCh
@@ -58,16 +56,18 @@ func (f *Foo2) Serve() chan error {
_ = w
- poolConfig := &roadrunner.Config{
+ poolConfig := roadrunner.Config{
NumWorkers: 10,
MaxJobs: 100,
AllocateTimeout: time.Second * 10,
DestroyTimeout: time.Second * 10,
- TTL: 1000,
- IdleTTL: 1000,
- ExecTTL: time.Second * 10,
- MaxPoolMemory: 10000,
- MaxWorkerMemory: 10000,
+ Supervisor: roadrunner.SupervisorConfig{
+ WatchTick: 60,
+ TTL: 1000,
+ IdleTTL: 10,
+ ExecTTL: time.Second * 10,
+ MaxWorkerMemory: 1000,
+ },
}
pool, err := f.wf.NewWorkerPool(context.Background(), poolConfig, nil)
diff --git a/plugins/rpc/rpc.go b/plugins/rpc/rpc.go
index a17b569f..0f6c9753 100755
--- a/plugins/rpc/rpc.go
+++ b/plugins/rpc/rpc.go
@@ -1,11 +1,12 @@
package rpc
import (
+ "net/rpc"
+
"github.com/spiral/endure"
"github.com/spiral/endure/errors"
"github.com/spiral/goridge/v2"
"github.com/spiral/roadrunner/v2/plugins/config"
- "net/rpc"
)
// RPCPluggable declares the ability to create set of public RPC methods.
diff --git a/plugins/rpc/rpc_test.go b/plugins/rpc/rpc_test.go
deleted file mode 100755
index 9ab1e3e8..00000000
--- a/plugins/rpc/rpc_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package rpc