Jump to content


P4.NET API - Timeout during unshelving

P4 P4.NET Powershell

  • Please log in to reply
1 reply to this topic

#1 mister_wilson

mister_wilson

    Advanced Member

  • Members
  • PipPipPip
  • 121 posts
  • LocationMontreal, Quebec

Posted 31 October 2014 - 08:00 PM

Hi,

I am currently having an issue with P4.NET API in a Powershell 3.0 script for unshelving. I am currently using the following segment:

        [string[]]$P4Args = @("-s",$CL)
        [Perforce.P4.P4Command]$P4Command = $P4Connection.CreateCommand("unshelve",$true,$P4Args)
        $P4Result = $P4Command.Run()

And getting the following error:

Command time out[380902]: unshelve -s 1928


The script is trying to unshelve 26k+ files.  Is there a way that I can increase the timeout value of the command?

P4V: P4 Visual Client/NTX64/2014.2/951414
Server version: P4D/LINUX26X86_64/2013.2/776904 (2014/01/24)

Let me know if you need more information.

Thanks,
Jonathan

#2 mister_wilson

mister_wilson

    Advanced Member

  • Members
  • PipPipPip
  • 121 posts
  • LocationMontreal, Quebec

Posted 31 October 2014 - 08:38 PM

Ok, after further investigation I was able to solve my problem. I found out that the default timeout value for any command is 5 seconds.
I was able to override the timeout value by setting $P4Connection.CommandTimeout to a new TimeSpan value (see below in RED)

$P4Connection.UserName = $P4Username

$P4Connection.Client = New-Object Perforce.P4.Client
$P4Connection.Client.Name = $Workspace
$P4Result = $P4Connection.Connect($null)
$P4Connection.CommandTimeout = New-TimeSpan -Seconds 60
$ConnectResult = $P4Repo.Connection.Login($P4Username,$null,$null)

I hope this information will be useful to someone else.

-JW





Also tagged with one or more of these keywords: P4, P4.NET, Powershell

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users