This commit is contained in:
eson 2018-11-28 02:39:59 +08:00
parent 9744128544
commit 4877177010
2 changed files with 32 additions and 8 deletions

View File

@ -97,8 +97,8 @@ func (task *Task) ExecuteOnPlan() {
for _, exec := range task.Plan.GetLoopValues() {
iexec := exec.GetValue().(IExecute)
if iexec.TimeTo() >= 0 {
iexec.CalculateTrigger()
task.Execute()
iexec.CalculateTrigger()
}
}
}

View File

@ -30,13 +30,37 @@ func TestExecutePlan(t *testing.T) {
time.Sleep(time.Second * 2)
for _, task := range person.Tasks.GetLoopValues() {
for _, pr := range task.GetValue().(*Task).ExecuteOnPlan() {
if pr.OK {
log.Println(pr.Response.Content()[0:100])
} else {
t.Error(pr.Error)
}
}
task.GetValue().(*Task).ExecuteOnPlan()
}
}
type C interface {
Execute()
}
type A struct {
C
}
func (a *A) Execute() {
log.Println("A")
}
func (a *A) EE() {
a.Execute()
a.Execute()
}
type B struct {
A
}
func (b *B) Execute() {
log.Println("B")
}
func TestCase1(t *testing.T) {
b := B{}
b.EE()
}