Fix(booking-job): Recovery on fillPassengerDetails
All checks were successful
ktm-booking-bot/ktm-booking-bot/pipeline/head This commit looks good

This commit is contained in:
2022-11-01 00:05:35 +08:00
parent ddc06c0c93
commit 594391714f

View File

@@ -268,8 +268,14 @@ func (env *Env) startBooking(job *Booking, username string, password string, cre
for !passthroughLaggingPage {
filledPassengerDetailContext, filledPassengerDetails := context.WithTimeout(context.Background(), 15*time.Second)
filledPassengerDetailContext, filledPassengerDetails := context.WithTimeout(context.Background(), 30*time.Second)
go func() {
defer func() {
if r := recover(); r != nil {
log.Println("Recovering from fillPassengerDetails panic...")
}
}()
page = fillPassengerDetails(page, name, gender, passport, passportExpiry, contact)
log.Println("Passenger details filled.")
filledPassengerDetails()