Symptoms
Scheduled task to fetch URL with PowerShell script is set in Subscriptions > example.com > Scheduled tasks.
On attempt to process large .xml files, this task fails:
Exception calling getresponse with "0" argument(s): The operation has timed out
Cause
Execution time limit of PowerShell script was exceeded.
Resolution
Note: if you don’t have administrative access to Plesk server via RDP, contact your hosting provider regarding the issue
-
Connect to Plesk server using RDP
-
Navigate to
folder and openÂ
%plesk_dir%AdditionalSchedulerfetch_url.ps1
.
Add
variable with value of 60000 Â in theÂ
webRequest.timeoutTry
 block to the script:...
Try {
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$webRequest = [net.WebRequest]::Create($url)
$webRequest.timeout = 60000;
...This equals to 60 seconds.Â
- To check if the script works, run it manually at Subscriptions > example.com > Scheduled tasks > Run Now. In order to find appropriate value, the limit can be gradually raised.