Add longPoll parameter to CheckForMessages function
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
4dfec86279
commit
04d2b0246a
@ -27,7 +27,7 @@ type ReceivedMessage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CheckForMessages checks for messages on a single server
|
// 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
|
count := 0
|
||||||
|
|
||||||
@ -63,6 +63,11 @@ func CheckForMessages(storage_path string, job *client.RequestsJob, timeout int)
|
|||||||
var toSrv meowlib.ToServerMessage
|
var toSrv meowlib.ToServerMessage
|
||||||
toSrv.PullRequest = crl
|
toSrv.PullRequest = crl
|
||||||
toSrv.From = job.Server.UserKp.Public
|
toSrv.From = job.Server.UserKp.Public
|
||||||
|
|
||||||
|
if longPoll {
|
||||||
|
toSrv.Timeout = int64(timeout)
|
||||||
|
}
|
||||||
|
|
||||||
data, err := job.Server.ProcessOutboundMessage(&toSrv)
|
data, err := job.Server.ProcessOutboundMessage(&toSrv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1, "CheckMessages: ProcessOutboundMessage", err
|
return -1, "CheckMessages: ProcessOutboundMessage", err
|
||||||
|
Loading…
Reference in New Issue
Block a user