rework config
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/owncloud/ocis/accounts/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/owncloud/ocis/glauth/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/glauth/pkg/config"
|
||||
"github.com/owncloud/ocis/glauth/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/owncloud/ocis/idp/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/idp/pkg/config"
|
||||
"github.com/owncloud/ocis/idp/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -20,20 +20,18 @@ func KillCommand(cfg *config.Config) *cli.Command {
|
||||
Category: "Runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
Destination: &cfg.Runtime.Hostname,
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
Destination: &cfg.Runtime.Port,
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort("localhost", "6060"))
|
||||
if err != nil {
|
||||
log.Fatal("dialing:", err)
|
||||
}
|
||||
|
||||
+19
-26
@@ -1,13 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/rpc"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -19,31 +14,29 @@ func ListCommand(cfg *config.Config) *cli.Command {
|
||||
Category: "Runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
Destination: &cfg.Runtime.Hostname,
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "10666",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
Destination: &cfg.Runtime.Port,
|
||||
Name: "port",
|
||||
Value: "10666",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
|
||||
if err != nil {
|
||||
log.Fatal("dialing:", err)
|
||||
}
|
||||
|
||||
var arg1 string
|
||||
|
||||
if err := client.Call("Service.List", struct{}{}, &arg1); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Println(arg1)
|
||||
//client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
|
||||
//if err != nil {
|
||||
// log.Fatal("dialing:", err)
|
||||
//}
|
||||
//
|
||||
//var arg1 string
|
||||
//
|
||||
//if err := client.Call("Service.List", struct{}{}, &arg1); err != nil {
|
||||
// log.Fatal(err)
|
||||
//}
|
||||
//
|
||||
//fmt.Println(arg1)
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/ocs/pkg/command"
|
||||
|
||||
@@ -2,7 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/onlyoffice/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/onlyoffice/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/proxy/pkg/command"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
|
||||
+8
-11
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
cli "github.com/micro/cli/v2"
|
||||
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
@@ -20,21 +20,18 @@ func RunCommand(cfg *config.Config) *cli.Command {
|
||||
Category: "Runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
Destination: &cfg.Runtime.Hostname,
|
||||
Name: "hostname",
|
||||
Value: "localhost",
|
||||
EnvVars: []string{"OCIS_RUNTIME_HOSTNAME"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
Destination: &cfg.Runtime.Port,
|
||||
Name: "port",
|
||||
Value: "6060",
|
||||
EnvVars: []string{"OCIS_RUNTIME_PORT"},
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
// TODO(refs) this implementation changes as we don't depend on os threads anymore.
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
|
||||
client, err := rpc.DialHTTP("tcp", net.JoinHostPort("localhost", "6060"))
|
||||
if err != nil {
|
||||
log.Fatal("dialing:", err)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/settings/pkg/command"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -2,7 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/storage/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/store/pkg/command"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/command"
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
mreg "github.com/asim/go-micro/v3/registry"
|
||||
"github.com/micro/cli/v2"
|
||||
tw "github.com/olekukonko/tablewriter"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/registry"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/web/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/web/pkg/config"
|
||||
|
||||
@@ -4,7 +4,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
"github.com/owncloud/ocis/webdav/pkg/command"
|
||||
|
||||
@@ -2,7 +2,7 @@ package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
)
|
||||
|
||||
// RootWithConfig applies cfg to the root flagset
|
||||
|
||||
@@ -2,7 +2,7 @@ package register
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
mzlog "github.com/asim/go-micro/plugins/logger/zerolog/v3"
|
||||
"github.com/asim/go-micro/v3/logger"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime/service"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/thejerf/suture"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
)
|
||||
|
||||
// Log configures a structure logger.
|
||||
|
||||
@@ -14,9 +14,10 @@ import (
|
||||
|
||||
"github.com/thejerf/suture"
|
||||
|
||||
onlyoffice "github.com/owncloud/ocis/onlyoffice/pkg/command"
|
||||
settings "github.com/owncloud/ocis/settings/pkg/command"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis/pkg/config"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime/log"
|
||||
"github.com/rs/zerolog"
|
||||
@@ -31,7 +32,7 @@ var (
|
||||
// Service represents a RPC service.
|
||||
type Service struct {
|
||||
Supervisor *suture.Supervisor
|
||||
ServicesRegistry map[string]func(context.Context, interface{}) suture.Service
|
||||
ServicesRegistry map[string]func(context.Context, *ociscfg.Config) suture.Service
|
||||
serviceToken map[string][]suture.ServiceToken
|
||||
context context.Context
|
||||
cancel context.CancelFunc
|
||||
@@ -81,7 +82,7 @@ func NewService(options ...Option) (*Service, error) {
|
||||
globalCtx, cancelGlobal := context.WithCancel(context.Background())
|
||||
|
||||
s := &Service{
|
||||
ServicesRegistry: make(map[string]func(context.Context, interface{}) suture.Service),
|
||||
ServicesRegistry: make(map[string]func(context.Context, *ociscfg.Config) suture.Service),
|
||||
Log: l,
|
||||
|
||||
serviceToken: make(map[string][]suture.ServiceToken),
|
||||
@@ -91,6 +92,7 @@ func NewService(options ...Option) (*Service, error) {
|
||||
cfg: opts.Config,
|
||||
}
|
||||
|
||||
s.ServicesRegistry["onlyoffice"] = onlyoffice.NewSutureService
|
||||
s.ServicesRegistry["settings"] = settings.NewSutureService
|
||||
|
||||
return s, nil
|
||||
@@ -134,9 +136,8 @@ func Start(o ...Option) error {
|
||||
fmt.Println(reason.String())
|
||||
}
|
||||
}()
|
||||
|
||||
for k, _ := range s.ServicesRegistry {
|
||||
s.serviceToken[k] = append(s.serviceToken[k], s.Supervisor.Add(s.ServicesRegistry[k](s.context, s.cfg.Settings)))
|
||||
s.serviceToken[k] = append(s.serviceToken[k], s.Supervisor.Add(s.ServicesRegistry[k](s.context, s.cfg)))
|
||||
}
|
||||
|
||||
go s.Supervisor.ServeBackground()
|
||||
@@ -152,7 +153,7 @@ func (s *Service) Start(name string, reply *int) error {
|
||||
return nil
|
||||
}
|
||||
//s.serviceToken[name] = append(s.serviceToken[name], s.Supervisor.Add(s.ServicesRegistry[name]))
|
||||
s.serviceToken["settings"] = append(s.serviceToken[name], s.Supervisor.Add(settings.NewSutureService(s.context, s.cfg.Settings)))
|
||||
//s.serviceToken["settings"] = append(s.serviceToken[name], s.Supervisor.Add(settings.NewSutureService(s.context, s.cfg)))
|
||||
*reply = 0
|
||||
return nil
|
||||
}
|
||||
@@ -165,12 +166,17 @@ func (s *Service) List(args struct{}, reply *string) error {
|
||||
// Kill a supervised process by subcommand name.
|
||||
func (s *Service) Kill(name string, reply *int) error {
|
||||
if len(s.serviceToken[name]) > 0 {
|
||||
for _, v := range s.serviceToken[name] {
|
||||
if err := s.Supervisor.Remove(v); err != nil {
|
||||
for i := range s.serviceToken[name] {
|
||||
fmt.Printf("\n\n%s\n%+v\n\n", name, s.serviceToken[name])
|
||||
if err := s.Supervisor.Remove(s.serviceToken[name][i]); err != nil {
|
||||
return err
|
||||
}
|
||||
delete(s.serviceToken, name)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("service %s not found", name)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"contrib.go.opencensus.io/exporter/zipkin"
|
||||
openzipkin "github.com/openzipkin/zipkin-go"
|
||||
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"go.opencensus.io/stats/view"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user