Browse Source

Chore(booking-job): Longer interval between thread load

master
Samuel Pua 3 years ago
parent
commit
5d665a7bc8
  1. 2
      backend/internal/ktmtrainbot/backgroundbookingjob.go

2
backend/internal/ktmtrainbot/backgroundbookingjob.go

@ -215,7 +215,6 @@ func (env *Env) startBooking(job *Booking, username string, password string, cre
threadCount := 10 threadCount := 10
for i := 0; i < threadCount; i++ { for i := 0; i < threadCount; i++ {
time.Sleep(time.Millisecond * 100)
go func() { go func() {
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
@ -243,6 +242,7 @@ func (env *Env) startBooking(job *Booking, username string, password string, cre
cancelGetBookingSlot() cancelGetBookingSlot()
pageChan <- currPage pageChan <- currPage
}() }()
time.Sleep(time.Millisecond * 1100)
} }
// Wait for either page received or timeout // Wait for either page received or timeout

Loading…
Cancel
Save