diff --git a/client/helpers/backgroundHelper.go b/client/helpers/backgroundHelper.go index 99bf11b..9f53225 100644 --- a/client/helpers/backgroundHelper.go +++ b/client/helpers/backgroundHelper.go @@ -27,7 +27,7 @@ type ReceivedMessage struct { } // CheckForMessages checks for messages on a single server -func CheckForMessages(storage_path string, job *client.RequestsJob, timeout int) (int, string, error) { +func CheckForMessages(storage_path string, job *client.RequestsJob, timeout int, longPoll bool) (int, string, error) { count := 0 @@ -63,6 +63,11 @@ func CheckForMessages(storage_path string, job *client.RequestsJob, timeout int) var toSrv meowlib.ToServerMessage toSrv.PullRequest = crl toSrv.From = job.Server.UserKp.Public + + if longPoll { + toSrv.Timeout = int64(timeout) + } + data, err := job.Server.ProcessOutboundMessage(&toSrv) if err != nil { return -1, "CheckMessages: ProcessOutboundMessage", err