Skip to content

Commit 78adf82

Browse files
authored
Merge pull request #50 from pge-bw/change-build-stats-lookup-interval
Change metrics stats lookup history interval
2 parents 4e00530 + 6c062f2 commit 78adf82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

metrics_stats.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/prometheus/client_golang/prometheus"
66
log "github.com/sirupsen/logrus"
77
devopsClient "github.com/webdevops/azure-devops-exporter/azure-devops-client"
8+
"time"
89
)
910

1011
type MetricsCollectorStats struct {
@@ -207,7 +208,7 @@ func (m *MetricsCollectorStats) CollectReleases(ctx context.Context, logger *log
207208
}
208209

209210
func (m *MetricsCollectorStats) CollectBuilds(ctx context.Context, logger *log.Entry, callback chan<- func(), project devopsClient.Project) {
210-
minTime := *m.CollectorReference.collectionLastTime
211+
minTime := time.Now().Add(-opts.Limit.BuildHistoryDuration)
211212

212213
buildList, err := AzureDevopsClient.ListBuildHistoryWithStatus(project.Id, minTime, "completed")
213214
if err != nil {

0 commit comments

Comments
 (0)