<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to increase the timeout value from API request?</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/5794/how-to-increase-the-timeout-value-from-api-request</link><description>Hello everyone! 
 Someone knows how could I increase the timeout value of an API Request? 
 I&amp;#39;m doing a request to an API, but this service takes time to respond for the tasks it does and I get on console the error: 
 
 Currently this is my code: 
 
</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to increase the timeout value from API request?</title><link>https://sugarclub.sugarcrm.com/thread/27077?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 00:27:19 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:1f43c3b5-9fd9-4c06-8857-86231ebc2e33</guid><dc:creator>Jerry Clark</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Norberto,&lt;br /&gt;&lt;br /&gt;You are likely restricted by either the apache timeout or the php timeout. In SugarCloud, the apache timeout is around 120 seconds&amp;nbsp;(edited) and the php timeout is 3600 seconds - so your request&amp;nbsp;is likely timing out&amp;nbsp;waiting for a response from apache.&lt;br /&gt;&lt;br /&gt;If you cannot make improvements to the code, you&amp;nbsp;have a&amp;nbsp;few options (in recommended order):&lt;br /&gt;&lt;br /&gt;1) Redesign the code to be a scheduled job. This would allow your code to be executed by the cron at a later time, though if an immediate result is needed this may not work.&lt;br /&gt;&lt;a href="https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.0/Architecture/Job_Queue/Jobs/"&gt;https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.0/Architecture/Job_Queue/Jobs/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) Redesign the request in a way that&amp;nbsp;mimics the 12.x module loader progress bar (or the mass update/import progress bar). This would essentially be a repeating request that triggers your code to run and&amp;nbsp;pings the server for updates on the progress of the script.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;3) Increase the apache timeout - this cannot be done in SugarCloud and should be avoided as it can cause your application to hang if too many users have lasting connections.&lt;br /&gt;&lt;br /&gt;I hope this gets you pointed in the right direction!&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase the timeout value from API request?</title><link>https://sugarclub.sugarcrm.com/thread/27065?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 14:57:43 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:54407034-217e-43e5-8b53-c94432a81b30</guid><dc:creator>Rodrigo Manara</dc:creator><description>&lt;p&gt;it that custom code, &amp;#39;cos it should not take a long time to have a response back from the api, Ensure you have the correct query properly done, by increment the timeout it will not solve the problem. I would suggest to check what is the bottle neck of your application. Timeout also depents on your load balance if you have one or your server response time setup.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;have a look here there you should have some info that you need&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_11.3/Architecture/Configurator/Core_Settings/"&gt;https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_11.3/Architecture/Configurator/Core_Settings/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>