MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / typesenseHasData

Function typesenseHasData

internal/search/reindex.go:463–473  ·  view source on GitHub ↗
(ctx context.Context, client *TypesenseClient)

Source from the content-addressed store, hash-verified

461}
462
463func typesenseHasData(ctx context.Context, client *TypesenseClient) bool {
464 resp, err := client.Client.Collection(CollectionTransactions).Retrieve(ctx)
465 if err != nil {
466 logrus.WithError(err).Debug("could not retrieve transactions collection for reindex")
467 return true
468 }
469 if resp.NumDocuments == nil {
470 return false
471 }
472 return *resp.NumDocuments > 0
473}
474
475func shouldReindex(ctx context.Context, client *TypesenseClient, ds database.IDataSource) bool {
476 if !dbHasData(ctx, ds) {

Callers 1

shouldReindexFunction · 0.85

Calls 1

DebugMethod · 0.45

Tested by

no test coverage detected