FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Retry API requests when a HTTP 503 "Service unavaliable" is received

Merged Robin Goodall requested to merge issue-6-retry-on-503 into master
1 file
+ 11
0
Compare changes
  • Side-by-side
  • Inline
+ 11
0
@@ -124,6 +124,17 @@ def sync(configuration, *, read_only=True):
LOG.info(
'Ignoring users whose organization unit path matches %r',
sync_config.ignore_google_org_unit_path_regex)
# Check that all users have an orgUnitPath
missing_org = [
u for u in all_google_users if 'orgUnitPath' not in u
]
if len(missing_org) != 0:
LOG.error('User entries missing orgUnitPath: %s (starting with %s)',
len(missing_org),
missing_org[0]['primaryEmail'] if 'primaryEmail' in missing_org[0]
else 'user with blank email')
raise RuntimeError('Sanity check failed: at least one user is missing orgUnitPath')
# Remove users matching regex
regex = re.compile(sync_config.ignore_google_org_unit_path_regex)
all_google_users = [
u for u in all_google_users if not regex.match(u['orgUnitPath'])
Loading