@@ -69,7 +69,7 @@ func (r *Repository[T, L]) FindByIdentifier(ctx context.Context, identifier stri
6969 return nil , fmt .Errorf ("query %s count: %w" , r .cfg .Table , err )
7070 }
7171
72- samples , err := r .getSamples (startMonth , endMonth )
72+ samples , err := r .getSamples (ctx , startMonth , endMonth )
7373 if err != nil {
7474 return nil , fmt .Errorf ("get samples: %w" , err )
7575 }
@@ -80,7 +80,7 @@ func (r *Repository[T, L]) FindByIdentifier(ctx context.Context, identifier stri
8080}
8181
8282func (r * Repository [T , L ]) FindAll (ctx context.Context , query string , startMonth , endMonth , limit , offset int ) (* L , error ) {
83- samples , err := r .getSamples (startMonth , endMonth )
83+ samples , err := r .getSamples (ctx , startMonth , endMonth )
8484 if err != nil {
8585 return nil , fmt .Errorf ("get samples: %w" , err )
8686 }
@@ -166,7 +166,7 @@ func (r *Repository[T, L]) FindSeries(ctx context.Context, identifier string, st
166166 return nil , fmt .Errorf ("count series: %w" , err )
167167 }
168168
169- samplesMap , err := r .getMonthlySamples (startMonth , endMonth )
169+ samplesMap , err := r .getMonthlySamples (ctx , startMonth , endMonth )
170170 if err != nil {
171171 return nil , fmt .Errorf ("get monthly samples: %w" , err )
172172 }
@@ -214,8 +214,8 @@ func (r *Repository[T, L]) queryPattern(query string) string {
214214 return query + "%"
215215}
216216
217- func (r * Repository [T , L ]) getSamples (startMonth , endMonth int ) (int , error ) {
218- monthlySamples , err := r .getMonthlySamples (startMonth , endMonth )
217+ func (r * Repository [T , L ]) getSamples (ctx context. Context , startMonth , endMonth int ) (int , error ) {
218+ monthlySamples , err := r .getMonthlySamples (ctx , startMonth , endMonth )
219219 if err != nil {
220220 return 0 , err
221221 }
@@ -228,8 +228,8 @@ func (r *Repository[T, L]) getSamples(startMonth, endMonth int) (int, error) {
228228 return total , nil
229229}
230230
231- func (r * Repository [T , L ]) getMonthlySamples (startMonth , endMonth int ) (map [int ]int , error ) {
232- return r .samplesCache .Get (startMonth , endMonth )
231+ func (r * Repository [T , L ]) getMonthlySamples (ctx context. Context , startMonth , endMonth int ) (map [int ]int , error ) {
232+ return r .samplesCache .Get (ctx , startMonth , endMonth )
233233}
234234
235235// CalculatePopularity returns a percentage rounded to 2 decimal places, capped at 100.
0 commit comments