mirror of
https://github.com/beego/bee.git
synced 2024-11-21 18:40:54 +00:00
remove useless codes again
This commit is contained in:
parent
9e602fd75f
commit
df0fb8595b
14
watch.go
14
watch.go
@ -6,13 +6,11 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
restart chan bool
|
|
||||||
cmd *exec.Cmd
|
cmd *exec.Cmd
|
||||||
state sync.Mutex
|
state sync.Mutex
|
||||||
eventTime = make(map[string]time.Time)
|
eventTime = make(map[string]time.Time)
|
||||||
@ -60,19 +58,7 @@ func NewWatcher(paths []string) {
|
|||||||
func Autobuild() {
|
func Autobuild() {
|
||||||
state.Lock()
|
state.Lock()
|
||||||
defer state.Unlock()
|
defer state.Unlock()
|
||||||
defer func() {
|
|
||||||
if err := recover(); err != nil {
|
|
||||||
str := ""
|
|
||||||
for i := 1; ; i += 1 {
|
|
||||||
_, file, line, ok := runtime.Caller(i)
|
|
||||||
if !ok {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
str = str + fmt.Sprintf("%v,%v", file, line)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
fmt.Println("start autobuild")
|
fmt.Println("start autobuild")
|
||||||
path, _ := os.Getwd()
|
path, _ := os.Getwd()
|
||||||
os.Chdir(path)
|
os.Chdir(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user