MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / removeTask

Method removeTask

pkg/funclet/file/path_manager.go:68–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68func (m *PathManager) removeTask() {
69 defer func() {
70 if err := recover(); err != nil {
71 m.logger.Errorf("remove task panic : %s", err)
72 }
73 }()
74 var emptyT int
75 for {
76 select {
77 case path, ok := <-m.clearCh:
78 if !ok {
79 m.logger.Infof("clear chan has been closed")
80 break
81 }
82 emptyT = 0
83 m.logger.V(8).Infof("remove by path name %s start", path)
84 err := m.RemoveByPathName(path)
85 if err != nil {
86 // unexpected error
87 m.logger.Errorf("remove by path name %s failed: %s", path, err)
88 } else {
89 m.logger.V(8).Infof("remove by path name %s success", path)
90 }
91 default:
92 time.Sleep(time.Duration(emptyT) * time.Second)
93 emptyT++
94 }
95
96 }
97}

Callers 1

NewPathManagerFunction · 0.95

Calls 5

RemoveByPathNameMethod · 0.95
ErrorfMethod · 0.80
InfofMethod · 0.80
VMethod · 0.80
SleepMethod · 0.65

Tested by

no test coverage detected