[add] yao run command task support
This commit is contained in:
parent
b477a29403
commit
38150e5d66
1 changed files with 11 additions and 0 deletions
11
cmd/run.go
11
cmd/run.go
|
|
@ -13,7 +13,9 @@ import (
|
|||
"github.com/yaoapp/kun/utils"
|
||||
"github.com/yaoapp/yao/config"
|
||||
"github.com/yaoapp/yao/engine"
|
||||
ischedule "github.com/yaoapp/yao/schedule"
|
||||
"github.com/yaoapp/yao/share"
|
||||
itask "github.com/yaoapp/yao/task"
|
||||
)
|
||||
|
||||
var runSilent = false
|
||||
|
|
@ -25,6 +27,7 @@ var runCmd = &cobra.Command{
|
|||
Run: func(cmd *cobra.Command, args []string) {
|
||||
defer share.SessionStop()
|
||||
defer plugin.KillAll()
|
||||
|
||||
defer func() {
|
||||
err := exception.Catch(recover())
|
||||
if err != nil {
|
||||
|
|
@ -103,6 +106,14 @@ var runCmd = &cobra.Command{
|
|||
|
||||
}
|
||||
|
||||
// Start Tasks
|
||||
itask.Start()
|
||||
defer itask.Stop()
|
||||
|
||||
// Start Schedules
|
||||
ischedule.Start()
|
||||
defer ischedule.Stop()
|
||||
|
||||
process := process.New(name, pargs...)
|
||||
res, err := process.Exec()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue