Don't sleep on first scan to ease testing
This commit is contained in:
@@ -27,9 +27,16 @@ type tag struct {
|
||||
}
|
||||
|
||||
func pollJob(pipeline database.Pipeline, pipelineConf config.PipelineConf, db database.Database) {
|
||||
firstScan := true
|
||||
for {
|
||||
// Don't sleep on first scan to ease testing
|
||||
// TODO: this should be replaced with a script that mocks a webhook
|
||||
if !firstScan {
|
||||
time.Sleep(time.Duration(pipeline.PollInterval) * time.Second)
|
||||
log.Infof("Polling repo %v", pipeline.Name)
|
||||
} else {
|
||||
firstScan = false
|
||||
}
|
||||
|
||||
prevRefs, err := db.GetPipelineRefs(pipeline.Id)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user