Merge pull request #3021 from omnivore-app/fix/readwise-integration

fix readwise integration
This commit is contained in:
Hongbo Wu 2023-10-26 12:58:55 +08:00 committed by GitHub
commit 3c067bd5e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,6 +148,8 @@ export class ReadwiseIntegration extends IntegrationService {
)
return response.status === 200
} catch (error) {
logger.error(error)
if (axios.isAxiosError(error)) {
if (error.response?.status === 429 && retryCount < 3) {
logger.info('Readwise API rate limit exceeded, retrying...')
@ -157,10 +159,6 @@ export class ReadwiseIntegration extends IntegrationService {
await wait(parseInt(retryAfter, 10) * 1000)
return this.syncWithReadwise(token, highlights, retryCount + 1)
}
logger.error(error.message)
} else {
logger.error(error)
}
return false