Menu

gspread.authorize.open_by_url() taking exactly 2 minutes to execute?

Reddit r/learnpython·u/LuminanceGayming·7 months ago
#3QRGIuPk
#info#worksheet#opening#getting#gspread
Reading 0:00
15s threshold

code:

logging.info(f"{Now()} Opening Doc")

doc = gspread.authorize.open_by_url(sheet_data["url"])

logging.info(f"{Now()} Getting Worksheet")

worksheet = doc.worksheet(sheet_data["worksheet"])

note: Now() is time since start in milliseconds

output:

INFO:7 Opening Doc
INFO:121086 Getting Worksheet

this code has worked fine for me for literal years until yesterday when it started taking exactly 2 minutes and 1 second to execute, every time (previously it took about 1 second).

here's a few more runs to demonstrate how incredibly consistent it is:

INFO:10 Opening Doc
INFO:121088 Getting Worksheet

INFO:8 Opening Doc
INFO:121105 Getting Worksheet

INFO:8 Opening Doc
INFO:121007 Getting Worksheet