Skip to content

Commit

Permalink
Check user_id for last minute flight
Browse files Browse the repository at this point in the history
  • Loading branch information
boozec committed Jul 10, 2024
1 parent bdd03dd commit 893c492
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/handlers/acmesky/st_save_last_minute_offer.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func STSaveLastMinuteOffer(client worker.JobClient, job entities.Job) {
}

var available_flight models.AvailableFlight
if found := db.Where("code = ? AND cost = ? AND departure_airport = ? AND arrival_airport = ? AND departure_time = ? AND arrival_time = ?",
input.Code, input.Cost, input.DepartureAirport, input.ArrivalAirport, input.DepartureTime, input.ArrivalTime).First(&available_flight).Error; found == nil {
if found := db.Where("code = ? AND cost = ? AND departure_airport = ? AND arrival_airport = ? AND departure_time = ? AND arrival_time = ? AND user_id = ?",
input.Code, input.Cost, input.DepartureAirport, input.ArrivalAirport, input.DepartureTime, input.ArrivalTime, input.UserId).First(&available_flight).Error; found == nil {
log.Warnf("[%s] [%d] Skip an already saved flight", job.Type, jobKey)
countNotSaved++
continue
Expand Down

0 comments on commit 893c492

Please sign in to comment.