make setting of google consent cookie thread safe

This commit is contained in:
Kovid Goyal 2022-07-31 12:01:14 +05:30
parent 7bc0399bda
commit a02453245c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -335,9 +335,10 @@ def google_parse_results(root, raw, log=prints, ignore_uncached=True):
def google_specialize_browser(br):
if not hasattr(br, 'google_consent_cookie_added'):
br.set_simple_cookie('CONSENT', 'YES+', '.google.com', path='/')
br.google_consent_cookie_added = True
with webcache_lock:
if not hasattr(br, 'google_consent_cookie_added'):
br.set_simple_cookie('CONSENT', 'YES+', '.google.com', path='/')
br.google_consent_cookie_added = True
return br