Skip to content

Commit

Permalink
fix uniqueness of flights per day
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed Aug 24, 2024
1 parent bfc0999 commit d13cd1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions go/cron/action/convert_flight_schedules.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ func (a *cfsAction) upsertFlights(ctx context.Context, bucket, prefix string, d
result := make([]*common.Flight, 0, max(len(flights), len(existing)))

for _, f := range flights {
result = append(result, f)
added[f.Id()] = struct{}{}
if _, ok := added[f.Id()]; !ok {
result = append(result, f)
added[f.Id()] = struct{}{}
}
}

for _, f := range existing {
Expand Down

0 comments on commit d13cd1e

Please sign in to comment.