Do not retry for some kind of errors in Github

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2025-05-22 01:41:10 +07:00
parent 02c6fe829b
commit a76895e60d
No known key found for this signature in database
GPG Key ID: BD80F68D68D8F7F2

View File

@ -1606,6 +1606,18 @@ export class GithubWorker implements IntegrationManager {
}
const ops = derivedClient.apply()
for (const d of withError) {
const errStr = JSON.stringify(d.error)
if (
errStr.includes('Bad credentials') ||
errStr.includes('Resource not accessible by integration') ||
errStr.includes('does not have permission to update') ||
errStr.includes('State cannot be changed') ||
errStr.includes('Not Found') ||
errStr.includes('Body is too long, Body is too long')
) {
// Skip this error's and not retry
continue
}
await ops.update(d, { error: null, needSync: '' })
}
await ops.commit()