mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-22 16:36:30 +00:00
Was throwing: currval of sequence builds_build_id_seq is not yet defined in this session
This commit is contained in:
parent
f65c4993c1
commit
16d68eddbf
2 changed files with 4 additions and 5 deletions
|
@ -243,10 +243,6 @@ func setupMetrics(g *errgroup.Group, store_ store.Store) {
|
|||
pendingJobs.Set(float64(stats.Stats.Pending))
|
||||
runningJobs.Set(float64(stats.Stats.Running))
|
||||
workers.Set(float64(stats.Stats.Workers))
|
||||
|
||||
buildCount, _ := store_.GetBuildCount()
|
||||
builds.Set(float64(buildCount))
|
||||
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
})
|
||||
|
@ -254,6 +250,8 @@ func setupMetrics(g *errgroup.Group, store_ store.Store) {
|
|||
for {
|
||||
repoCount, _ := store_.GetRepoCount()
|
||||
userCount, _ := store_.GetUserCount()
|
||||
buildCount, _ := store_.GetBuildCount()
|
||||
builds.Set(float64(buildCount))
|
||||
users.Set(float64(userCount))
|
||||
repos.Set(float64(repoCount))
|
||||
time.Sleep(10 * time.Second)
|
||||
|
|
|
@ -11,4 +11,5 @@ WHERE repo_active = true
|
|||
|
||||
-- name: count-builds
|
||||
|
||||
SELECT currval('builds_build_id_seq');
|
||||
SELECT count(1)
|
||||
FROM builds
|
||||
|
|
Loading…
Reference in a new issue