incompleted cm
This commit is contained in:
parent
6fb4e8e935
commit
e99727b62a
|
@ -12,6 +12,7 @@ import (
|
|||
"log"
|
||||
|
||||
"github.com/kataras/go-errors"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -266,5 +267,21 @@ func (c *CrawlerManager)removeProcessFile(pid *string) {
|
|||
}
|
||||
|
||||
|
||||
func (c *CrawlerManager)activeCrawler(container *string) []string {
|
||||
|
||||
var dirs []string
|
||||
existConfigFileDir(ConfigFolder,*container,&dirs)
|
||||
|
||||
if len(dirs) <= 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
var r []string
|
||||
for _, path := range dirs {
|
||||
r = append(r, filepath.Base(path))
|
||||
}
|
||||
|
||||
return r
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -247,4 +247,27 @@ func TestRunRun(t *testing.T) {
|
|||
|
||||
GetInstance().stopContainer(&c)
|
||||
|
||||
}
|
||||
|
||||
func TestActiveCrawler(t *testing.T) {
|
||||
|
||||
c := "java"
|
||||
GetInstance().runContainer(&c)
|
||||
|
||||
aa := GetInstance().activeCrawler(&c)
|
||||
|
||||
t.Log(aa)
|
||||
|
||||
GetInstance().stopContainer(&c)
|
||||
|
||||
}
|
||||
|
||||
func TestErer(t *testing.T) {
|
||||
|
||||
var asdf []string
|
||||
|
||||
asdf = nil
|
||||
|
||||
t.Log(len(asdf))
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user