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