change longpoll job array param type
This commit is contained in:
@ -192,7 +192,7 @@ func ReadMessage(messageFilename string) ([]string, []string, string, error) {
|
||||
}
|
||||
|
||||
// CheckForMessages checks for messages on a single server
|
||||
func LongPollForMessages(storage_path string, jobs []client.RequestsJob, timeout int, longPoll bool) (int, string, error) {
|
||||
func LongPollForMessages(storage_path string, jobs []*client.RequestsJob, timeout int, longPoll bool) (int, string, error) {
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
@ -203,7 +203,7 @@ func LongPollForMessages(storage_path string, jobs []client.RequestsJob, timeout
|
||||
|
||||
for _, job := range jobs {
|
||||
wg.Add(1)
|
||||
go func(job client.RequestsJob) {
|
||||
go func(job *client.RequestsJob) {
|
||||
defer wg.Done()
|
||||
|
||||
for {
|
||||
@ -211,7 +211,7 @@ func LongPollForMessages(storage_path string, jobs []client.RequestsJob, timeout
|
||||
case <-ctx.Done():
|
||||
return
|
||||
default:
|
||||
cnt, _, err := CheckForMessages(storage_path, &job, timeout, true)
|
||||
cnt, _, err := CheckForMessages(storage_path, job, timeout, true)
|
||||
if err != nil {
|
||||
continue // Optionally handle/log error
|
||||
}
|
||||
|
Reference in New Issue
Block a user