graph/db: let ForEachNode take a context

This commit is contained in:
Elle Mouton committed 2025-07-08 15:11:02 +02:00
1 parent f05ef2db97
commit 1e804a3d5f
8 files changed
+14 -14

No files matched your search

+3 -5
View File
@@ -783,12 +783,10 @@ func (s *SQLStore) ForEachSourceNodeChannel(ctx context.Context,
// _MUST_ only be called from within the call-back.
//
// NOTE: part of the V1Store interface.
func (s *SQLStore) ForEachNode(cb func(tx NodeRTx) error) error {
var (
ctx = context.TODO()
lastID int64 = 0
)
func (s *SQLStore) ForEachNode(ctx context.Context,
cb func(tx NodeRTx) error) error {
var lastID int64 = 0
handleNode := func(db SQLQueries, dbNode sqlc.Node) error {
node, err := buildNode(ctx, db, &dbNode)
if err != nil {