Open kimpurcell opened 4 years ago
Where it says
; Use a temporary variable for ID in case more calls are made
; before we receive a response.
ID := this.ID += 1
this.ws.Send(Chrome.Jxon_Dump({"id": ID
, "params": Params ? Params : {}
, "method": DomainAndMethod}))
if !WaitForResponse
return
; Wait for the response
this.responses[ID] := False
while !this.responses[ID]
Sleep, 50
can you change it to say
; Use a temporary variable for ID in case more calls are made
; before we receive a response.
ID := this.ID += 1
if WaitForResponse
this.responses[ID] := False
this.ws.Send(Chrome.Jxon_Dump({"id": ID
, "params": Params ? Params : {}
, "method": DomainAndMethod}))
if !WaitForResponse
return
; Wait for the response
while !this.responses[ID]
Sleep, 50
and see if that works any better?
Thanks, testing it now and will let you know...
It works for a little while, then goes into an infinite loop on Sleep.
Here's the log:
279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.05) 279: While,!this.responses[ID] 280: Sleep,50 (0.02)
May I propose a solution? My theory is that the Call at some occasions is not recieved by chrome. So It would be logically to repeat the call.
Please test this and let me know your experiences.
; Use a temporary variable for ID in case more calls are made
; before we receive a response.
ChromeRepeat:
ID := this.ID += 1
this.responses[ID] := False
this.ws.Send(Chrome.Jxon_Dump({"id": ID
, "params": Params ? Params : {}
, "method": DomainAndMethod}))
if !WaitForResponse
return
; Wait for the response
;~ this.responses[ID] := False
while !this.responses[ID]
{
Sleep, 50
if (A_Index=50){
; MsgBox, Error
Goto, ChromeRepeat
return 0
}
}
Have a script that runs every 15 minutes. Stops working after a while and saw that it's hung on ; Wait for the response this.responses[ID] := False while !this.responses[ID] Sleep, 50