Beispiel #1
0
func Run(which string) {
	exec.Command("cmd.exe", "/c", "title", config.APP_FULL_NAME).Start()
	defer func() {
		if cache.Task.InheritDeduplication {
			scheduler.SaveDeduplication()
		}
	}()

	// 选择运行界面
	switch which {
	case "gui":
		gui.Run()

	case "cmd":
		cmd.Run()

	case "web":
		fallthrough
	default:
		ctrl := make(chan os.Signal, 1)
		signal.Notify(ctrl, os.Interrupt, os.Kill)
		go web.Run()
		<-ctrl
	}
}
Beispiel #2
0
func main() {
	// 开启错误日志调试功能(打印行号及Debug信息)
	logs.Debug(true)

	defer func() {
		if err := recover(); err != nil {
			logs.Log.Emergency("%v", err)
		}
	}()

	setConf() // 不调用则为默认值

	// 开始运行
	web.Run() // web版
	// cmd.Run() // cmd版
	// gui.Run() // gui版
}
Beispiel #3
0
func run(which string) {
	exec.Command("/bin/sh", "-c", "title", config.APP_FULL_NAME).Start()
	defer func() {
		scheduler.TryFlushHistory()
	}()

	// 选择运行界面
	switch which {
	case "cmd":
		cmd.Run()

	case "web":
		fallthrough
	default:
		ctrl := make(chan os.Signal, 1)
		signal.Notify(ctrl, os.Interrupt, os.Kill)
		go web.Run()
		<-ctrl
	}
}
func run(which string) {
	exec.Command("cmd.exe", "/c", "title", config.FULL_NAME).Start()

	// 选择运行界面
	switch which {
	case "gui":
		gui.Run()

	case "cmd":
		cmd.Run()

	case "web":
		fallthrough
	default:
		ctrl := make(chan os.Signal, 1)
		signal.Notify(ctrl, os.Interrupt, os.Kill)
		go web.Run()
		<-ctrl
	}
}
Beispiel #5
0
func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	web.Run()
}