Jump to content

async script on trigger


tat

Recommended Posts

Hi there.

 

I would like to run the after-checkin trigger script asynchronously.

I tried to achieve this using the C# Process talked about in the https://forum.plasticscm.com/topic/828-async-script-on-trigger/ topic, but I couldn't!

 

The code looks like this

var startInfo = new ProcessStartInfo
{
    FileName = "sh",
    Arguments = "sleep.sh"
    CreateNoWindow = true,
};
Process.Start(startInfo);

The content of sleep.sh looks like this

#! /usr/bin/sh

sleep 30
exit 0

 

When I do a checkin from the Plastic SCM GUI client, the checkin seems to wait until sleep is over.

Is there any way to execute the process asynchronously with after-checkin trigger?

 

Thank you for your time.

Link to comment
Share on other sites

  • 2 weeks later...

Triggers are designed to be synchronous to return an outcome to the client with the possibility of action, but since 10.0.16.6280, you can now spawn a child process and the GUI does not wait for it to complete.

All platforms - Plastic: Triggers no longer wait if parent process has exited and a child process is invoked.

Previously, triggers that launched a child process would wait for it to exit before returning. Now they allow the child process to run in the background while the trigger returns.

For example, this could be done with the following line in a batch file...

start /b run_trigger.exe

Hope this helps!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...