글

라벨이 Exponential Backoff인 게시물 표시

Writes Apps Script errors in this spreadsheet.

이미지
저는 Apps Script로 앱을 만듭니다. https://www.eojji.com/app Google Drive REST API를 사용하는데 다양한 오류가 발생합니다. 다른 분들과 공유하기 위해서 스프레드시트에 기록 중입니다. https://docs.google.com/spreadsheets/d/1p-saNPVWm1ZTBtryYkxY8rL0wk_pQClM5xThogaHtBs/edit?usp=sharing Writes Apps Script errors in spreadsheet.png 이 시트에 기록할 내용이 있으면 보내 주세요. 개발에 반영하겠습니다. https://hi.eojji.com/ 만약 파일 복사 API 호출에서 발생한 오류가 일시적이면 지수적 감속으로 다시 시도합니다.   if (resp.name == 'HttpResponseException' ||       resp.message.indexOf('Internal Error') >= 0 ||       resp.message.indexOf('Backend Error') >= 0 ||       resp.message.indexOf('Transient failure') >= 0 ) {           copiedState.check = '-2'; // 지수적 감속 참고: Deduper Resolve Errors, Exponential backoff https://eojji.blogspot.com/2019/06/deduper-resolve-errors-exponential.html Resolve errors - Google Drive API https://developers.google.com/drive/api/v2/handle-errors Troubleshoo...

Deduper Resolve Errors, Exponential backoff

Remove Duplicate files in Google Drive 에 이어서 Apps script로 구글 드라이브 API를 호출하는데 구글 서버 오류가 발생하면 그냥 종료합니다. 앱 사용자가 로그 스프레드시트를 보고 중단된 이유에 따라 Find 버튼을 클릭할 수 있습니다. 서버 오류를 처리하기 위해서 ... Error GoogleJsonResponseException 다음 오류로 인해 drive.files.list API를 호출하지 못했습니다. Internal Error GoogleJsonResponseException 다음 오류로 인해 drive.parents.insert API를 호출하지 못했습니다. Backend Error 오류를 해결하기 위해서 찾아보니 Exponential backoff를 권장합니다. Resolve errors https://developers.google.com/drive/api/v2/handle-errors 500: Backend error An unexpected error occurred while processing the request. Retry failed requests to resolve errors https://developers.google.com/drive/api/v3/handle-errors#exponential-backoff You can periodically retry a failed request over an increasing amount of time to handle errors related to rate limits, network volume, or response time. For example, you might retry a failed request after one second, then after two seconds, and then after four seconds. This method, cal...