Skip to content

Commit 68ed60d

Browse files
committed
Linter fixes
1 parent 759861b commit 68ed60d

File tree

3 files changed

+3
-50
lines changed

3 files changed

+3
-50
lines changed

pkg/datasources/github/datasource.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (d *Datasource) convertEventToBlock(ctx context.Context, event *github.Even
236236
"",
237237
0,
238238
0,
239-
event.CreatedAt.Time.UTC(),
239+
event.CreatedAt.UTC(),
240240
event.GetPublic(),
241241
payloadJSON,
242242
d.instanceName,
@@ -264,7 +264,7 @@ func (d *Datasource) convertEventToBlock(ctx context.Context, event *github.Even
264264
"",
265265
0,
266266
0,
267-
event.CreatedAt.Time.UTC(),
267+
event.CreatedAt.UTC(),
268268
event.GetPublic(),
269269
payloadJSON,
270270
d.instanceName,
@@ -282,7 +282,7 @@ func (d *Datasource) convertEventToBlock(ctx context.Context, event *github.Even
282282
repo.GetLanguage(),
283283
repo.GetStargazersCount(),
284284
repo.GetForksCount(),
285-
event.CreatedAt.Time.UTC(),
285+
event.CreatedAt.UTC(),
286286
event.GetPublic(),
287287
payloadJSON,
288288
d.instanceName,

pkg/storage/manager.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"os"
66
"path/filepath"
7-
"sort"
87
"sync"
98
"time"
109

@@ -352,42 +351,6 @@ func (m *Manager) SearchDatasourcesPagedWithDateRange(datasourceNames []string,
352351

353352
// sortDatasourcesByNewestBlock sorts datasources by the creation time of their newest block.
354353
// Returns a slice of datasource names ordered by the newest block time (newest first).
355-
func (m *Manager) sortDatasourcesByNewestBlock(datasourceResults map[string][]core.Block) []string {
356-
type datasourceWithTime struct {
357-
name string
358-
newestTime time.Time
359-
}
360-
361-
var datasources []datasourceWithTime
362-
363-
for dsName, blocks := range datasourceResults {
364-
if len(blocks) > 0 {
365-
// Find the newest block in this datasource (blocks should already be sorted by time)
366-
newestTime := blocks[0].CreatedAt()
367-
for _, block := range blocks {
368-
if block.CreatedAt().After(newestTime) {
369-
newestTime = block.CreatedAt()
370-
}
371-
}
372-
datasources = append(datasources, datasourceWithTime{
373-
name: dsName,
374-
newestTime: newestTime,
375-
})
376-
}
377-
}
378-
379-
// Sort datasources by newest block time (newest first)
380-
sort.Slice(datasources, func(i, j int) bool {
381-
return datasources[i].newestTime.After(datasources[j].newestTime)
382-
})
383-
384-
result := make([]string, len(datasources))
385-
for i, ds := range datasources {
386-
result[i] = ds.name
387-
}
388-
389-
return result
390-
}
391354

392355
// GetStats returns storage statistics for all datasources including total blocks
393356
// and datasource-specific metrics. The returned map includes individual datasource

pkg/storage/search.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,6 @@ func (s *SearchService) executeSearch(params SearchParams) (map[string][]core.Bl
285285
}
286286

287287
// convertResultsToMap converts search results to a map for sorting
288-
func (s *SearchService) convertResultsToMap(results []searchResult) map[string][]core.Block {
289-
resultMap := make(map[string][]core.Block)
290-
for _, result := range results {
291-
if result.err == nil {
292-
resultMap[result.datasource] = result.blocks
293-
}
294-
}
295-
return resultMap
296-
}
297-
298288
// searchDatasourcesInParallel executes searches across multiple datasources in parallel.
299289
func (s *SearchService) searchDatasourcesInParallel(datasources []string, query string, limit int, orderByTime bool, startDate, endDate *time.Time) []searchResult {
300290
resultChan := make(chan searchResult, len(datasources))

0 commit comments

Comments
 (0)