@@ -15,7 +15,7 @@ import (
1515)
1616
1717type Sync interface {
18- Run (context.Context ) error
18+ Run (context.Context , string ) error
1919}
2020
2121type sync struct {
@@ -39,12 +39,12 @@ func NewSync(
3939 }
4040}
4141
42- func (s * sync ) Run (ctx context.Context ) error {
42+ func (s * sync ) Run (ctx context.Context , namespace string ) error {
4343 s .logger .Info ("Starting sync" )
4444
4545 s .logger .Debug ("Warming up" )
4646
47- err := s .Warmup (ctx )
47+ err := s .Warmup (ctx , namespace )
4848 if err != nil {
4949 return errors .Wrap (err , "warmup failed" )
5050 }
@@ -139,15 +139,17 @@ func (s *sync) Run(ctx context.Context) error {
139139 return g .Wait ()
140140}
141141
142- func (s * sync ) Warmup (ctx context.Context ) error {
142+ func (s * sync ) Warmup (ctx context.Context , namespace string ) error {
143143 g , ctx := errgroup .WithContext (ctx )
144144
145145 resource := s .factory ()
146146 entities , err := s .db .YieldAll (ctx , func () database.Entity {
147147 return s .factory ()
148- }, s .db .BuildSelectStmt (resource , resource .Fingerprint ()), struct {}{ })
148+ }, s .db .BuildSelectStmt (resource , resource .Fingerprint ()), struct { Namespace string }{ Namespace : namespace })
149149 com .ErrgroupReceive (ctx , g , err )
150150
151+ fmt .Println (s .db .BuildSelectStmt (resource , resource .Fingerprint ()))
152+
151153 g .Go (func () error {
152154 for {
153155 select {
0 commit comments