I have a python script running on schedule every 10 minutes or so to check something in our AGOL. I use the arcgis.gis module as below.
from arcgis.gis import GIS
gis = GIS('portalURL', user, 'password')
The script in running every 10 minutes. However, some times, not all time, I receive error of "Your request has timed out. (code 504)" or "Too many invalid logins. Please try again later. (Error Code: 400) ". I suspect that it takes too long to log into our AGOL. My question is: Is there a method to "log off" gis? Or should I simply set the gis = None will resolve this?
Thanks,
Ming