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) {
|
func pollJob(pipeline database.Pipeline, pipelineConf config.PipelineConf, db database.Database) {
|
||||||
|
firstScan := true
|
||||||
for {
|
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)
|
time.Sleep(time.Duration(pipeline.PollInterval) * time.Second)
|
||||||
log.Infof("Polling repo %v", pipeline.Name)
|
log.Infof("Polling repo %v", pipeline.Name)
|
||||||
|
} else {
|
||||||
|
firstScan = false
|
||||||
|
}
|
||||||
|
|
||||||
prevRefs, err := db.GetPipelineRefs(pipeline.Id)
|
prevRefs, err := db.GetPipelineRefs(pipeline.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user