아래 코드는 Google의 nodejs 클라이언트 버전 0.7
here을 사용하여 Google 웹 로그 분석보고 API를 호출합니다. 일부 실행에서는 항상 socket hang up
오류가 반환되지만 항상 그렇지는 않습니다. Google 서버가 끝날 때 오류가 발생합니까? 디버깅하기 쉬운 방법이 있습니까? BTW 나는 속도 제한으로 인해 발생하는지 확실하지 않은 여러 통화를 연속적으로하고 있습니다.노드 클라이언트를 통해 Google API를 호출 할 때 "소켓 끊기"오류가 발생했습니다.
gapi = require "googleapis"
authClient = new gapi.auth.JWT(
config.ga.clientEmail,
config.ga.privateKeyPath,
null,
[config.ga.scopeUri]
)
authPromise = new Promise (resolve, reject) ->
authClient.authorize (err, token) ->
resolve token
return
return
authPromise.then ->
gapi.discover('analytics', 'v3')
.withAuthClient(authClient)
.execute (err, client) ->
...