@@ -58,6 +58,7 @@ func InitTicker(store *store.Store, scheduler *scheduler.Scheduler) {
58
58
// Every file will be handled as an active pipeline and therefore
59
59
// saved in the global active pipelines slice.
60
60
func checkActivePipelines () {
61
+ var existingPipelineNames []string
61
62
files , err := ioutil .ReadDir (gaia .Cfg .PipelinePath )
62
63
if err != nil {
63
64
gaia .Cfg .Logger .Error ("cannot read pipelines folder" , "error" , err .Error (), "path" , gaia .Cfg .PipelinePath )
@@ -78,6 +79,8 @@ func checkActivePipelines() {
78
79
// Get real pipeline name and check if the global active pipelines slice
79
80
// already contains it.
80
81
pName := getRealPipelineName (n , pType )
82
+ // Add the real pipeline name to the slice of existing pipeline names.
83
+ existingPipelineNames = append (existingPipelineNames , pName )
81
84
if GlobalActivePipelines .Contains (pName ) {
82
85
// If SHA256Sum is set, we should check if pipeline has been changed.
83
86
p := GlobalActivePipelines .GetByName (pName )
@@ -113,7 +116,7 @@ func checkActivePipelines() {
113
116
continue
114
117
}
115
118
116
- // We couldn't finde the pipeline. Create a new one.
119
+ // We couldn't find the pipeline. Create a new one.
117
120
var shouldStore = false
118
121
if pipeline == nil {
119
122
// Create pipeline object and fill it with information
@@ -152,6 +155,7 @@ func checkActivePipelines() {
152
155
GlobalActivePipelines .Append (* pipeline )
153
156
}
154
157
}
158
+ GlobalActivePipelines .RemoveDeletedPipelines (existingPipelineNames )
155
159
}
156
160
157
161
// getPipelineType looks up for specific suffix on the given file name.
0 commit comments