<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: arcgis.gis log off? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1037928#M5752</link>
    <description>&lt;P&gt;Signing in every 10 minutes by the same user seems a little bit wasteful from the server perspective, because every time it will go through the authentication and authorization process and generate a new token when the previous tokens are still valid...&lt;/P&gt;&lt;P&gt;Just some thoughts for further research:&lt;/P&gt;&lt;P&gt;It may be worth it to keep the state of the GIS object somehow, but the GIS object can't be serialized using json.dumps(gis)...&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about running an application with an endless loop?&amp;nbsp; you can delay the execution for 10 minutes in every loop instead of scheduling the execution using a third party software.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Mar 2021 07:13:52 GMT</pubDate>
    <dc:creator>simoxu</dc:creator>
    <dc:date>2021-03-18T07:13:52Z</dc:date>
    <item>
      <title>arcgis.gis log off?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1037787#M5749</link>
      <description>&lt;P&gt;I have a python script running on schedule every 10 minutes or so to check something in our AGOL.&amp;nbsp; I use the arcgis.gis module as below.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;arcgis.gis &lt;SPAN&gt;import &lt;/SPAN&gt;GIS&lt;BR /&gt;gis = GIS(&lt;SPAN&gt;'portalURL'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;user&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'password'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ming&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 19:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1037787#M5749</guid>
      <dc:creator>MingHome</dc:creator>
      <dc:date>2021-03-17T19:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.gis log off?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1037928#M5752</link>
      <description>&lt;P&gt;Signing in every 10 minutes by the same user seems a little bit wasteful from the server perspective, because every time it will go through the authentication and authorization process and generate a new token when the previous tokens are still valid...&lt;/P&gt;&lt;P&gt;Just some thoughts for further research:&lt;/P&gt;&lt;P&gt;It may be worth it to keep the state of the GIS object somehow, but the GIS object can't be serialized using json.dumps(gis)...&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about running an application with an endless loop?&amp;nbsp; you can delay the execution for 10 minutes in every loop instead of scheduling the execution using a third party software.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 07:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1037928#M5752</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-03-18T07:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.gis log off?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1038029#M5753</link>
      <description>&lt;P&gt;Thanks and agree!&amp;nbsp;However, currently the burden is on ESRI side, not much on me.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_savoring_food:"&gt;😋&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Your mention about the service token reminded me that I was using "request" with service token for operations to AGOL (query, delete, add, update featureLayer) before using "arcgis.gis" module. The gis object cannot be save to json, but a token can. But in this way, I need to go back to my old and a little more complicated code again.&lt;/P&gt;&lt;P&gt;Anyone have a better ideal!?&lt;/P&gt;&lt;P&gt;Ming&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 13:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1038029#M5753</guid>
      <dc:creator>MingHome</dc:creator>
      <dc:date>2021-03-18T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.gis log off?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1550263#M10782</link>
      <description>&lt;P&gt;I have the same issues, and wondering if there is a method to log out AGOL.. I think it should?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2024 15:49:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-gis-log-off/m-p/1550263#M10782</guid>
      <dc:creator>NicoleHuang</dc:creator>
      <dc:date>2024-10-19T15:49:02Z</dc:date>
    </item>
  </channel>
</rss>

