79315514

Date: 2024-12-29 11:46:08
Score: 3
Natty:
Report link

This is resolved from comments. Thanks @VPfB and @user2357112. This issue was due to a misunderstanding of how decorators work in Python. The get_requests() is first called inside of the decorator as opposed to as outside of the decorate as I initially thought. The correct implementation should call status_code = func(*args, **kwargs), inspect the status_code and return the status_code.

Alternatively,@SIGHUP offered the requests module retry logic. This completely doable and works as an alternative to setting up best methods to retry requests.

Marked the answer as Community Wiki

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @VPfB
  • User mentioned (0): @user2357112
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: and