Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions api/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"

"api.audius.co/config"
core_indexer "api.audius.co/indexer"
"connectrpc.com/connect"
corev1 "github.com/OpenAudio/go-openaudio/pkg/api/core/v1"
"github.com/gofiber/fiber/v2"
Expand Down Expand Up @@ -39,8 +38,12 @@ func (app *ApiServer) getCoreIndexerHealth(ctx context.Context) (*coreIndexerHea
}
chainHeight := nodeInfo.Msg.CurrentHeight

// ETL tracks the highest indexed chain height in `core_indexed_blocks`.
// COALESCE handles the cold-start case before any blocks are indexed.
var indexerLastBlockHeight int64
err = app.pool.QueryRow(ctx, "SELECT COALESCE(last_checkpoint, 0) FROM indexing_checkpoints WHERE tablename = $1", core_indexer.CoreIndexerCheckpointName).Scan(&indexerLastBlockHeight)
err = app.pool.QueryRow(ctx,
"SELECT COALESCE(MAX(height), 0) FROM core_indexed_blocks",
).Scan(&indexerLastBlockHeight)
if err != nil {
return nil, fiber.NewError(fiber.StatusInternalServerError, "Failed to get core indexer last block height")
}
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
connectrpc.com/connect v1.18.1
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/Doist/unfurlist v0.0.0-20250409100812-515f2735f8e5
github.com/OpenAudio/go-openaudio v1.2.13
github.com/OpenAudio/go-openaudio v1.3.0
github.com/aquasecurity/esquery v0.2.0
github.com/axiomhq/axiom-go v0.23.0
github.com/axiomhq/hyperloglog v0.2.5
Expand Down Expand Up @@ -55,6 +55,7 @@ require (
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/OpenAudio/go-openaudio/pkg/etl v1.3.0 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEV
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OpenAudio/go-openaudio v1.2.13 h1:ILPaM6EneDQMoKXSyjb///758I7Ou52e76NvNmCkcdY=
github.com/OpenAudio/go-openaudio v1.2.13/go.mod h1:+xl3SeIY7pc6CfwO1qmYjWELLSseQaulqSQefE6i2FA=
github.com/OpenAudio/go-openaudio v1.3.0 h1:Is1FFStckE116ZNuPNzu3wzdZdaYd6xslyciPgGut0E=
github.com/OpenAudio/go-openaudio v1.3.0/go.mod h1:+xl3SeIY7pc6CfwO1qmYjWELLSseQaulqSQefE6i2FA=
github.com/OpenAudio/go-openaudio/pkg/etl v1.3.0 h1:RooZJ2OIDe7kLUNUVrQGHQFFyyHtayryhfG19MHIADw=
github.com/OpenAudio/go-openaudio/pkg/etl v1.3.0/go.mod h1:LZKiU9vBYzlZzn6oPRHHLPXteBtMKQPegNH9bX9JuH8=
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI=
Expand Down
41 changes: 0 additions & 41 deletions indexer/index_user.go

This file was deleted.

108 changes: 0 additions & 108 deletions indexer/index_user_test.go

This file was deleted.

Loading
Loading