Skip to content

取消任务之后,任务线程不会取消 #4

Description

@FLYyyyy2016

timer.C这个chan在CancelJob之后没有关闭。
timer.Stop函数官方注释表示“ Stop does not close the channel”,所以导致

		go func() {
			// wait...     
                        //but if job cancel,con't recive anything;
			<-j.JTimer.timer.C
			// run job function
			j.run()
			// set job done
			jobSet.setJobDone(j.ID)
		}()

这里一直等待,不会回收线程。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions