The fetcher's "saved opportunities" and "fetched opportunities" lines now name the source
This commit is contained in:
1 parent
50ee510520
commit
c678b02662
4 files changed
+21
-3
No files matched your search
@@ -246,6 +246,9 @@ func (f *Fetcher) startFrom(
|
||||
// Opportunities that match the skip rules (see WithSkipRules) are marked
|
||||
// Skipped first. The store keeps the marks of an opportunity it already
|
||||
// has, so only new ones are skipped.
|
||||
//
|
||||
// Each save is one worker's, so its lines are logged with the first
|
||||
// opportunity's Source.
|
||||
func (f *Fetcher) save(
|
||||
ctx context.Context,
|
||||
logger *slog.Logger,
|
||||
@@ -255,6 +258,10 @@ func (f *Fetcher) save(
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(opportunities) > 0 {
|
||||
logger = logger.With("source", opportunities[0].Source)
|
||||
}
|
||||
|
||||
filters := f.markSkipped(opportunities)
|
||||
|
||||
result, err := f.store.SaveOpportunities(ctx, opportunities)
|
||||
|
||||
Reference in new issue
Block a user