- replace all goroutine and AfterFunc with recover version
This commit is contained in:
@@ -21,14 +21,14 @@ const (
|
||||
)
|
||||
|
||||
func (c *PurchaseHandler) StartRefreshComment() {
|
||||
time.AfterFunc(5*time.Second, func() {
|
||||
utils.AfterFuncWithRecover(5*time.Second, func() {
|
||||
c.refreshCommentOnce()
|
||||
})
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) refreshCommentOnce() {
|
||||
c.RefreshComment(time.Now().Add(-RefreshCommentTime), time.Now())
|
||||
time.AfterFunc(RefreshCommentTimeInterval, func() {
|
||||
utils.AfterFuncWithRecover(RefreshCommentTimeInterval, func() {
|
||||
c.refreshCommentOnce()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user