Forum Discussion

mchatter's avatar
mchatter
New Contributor
13 years ago

Using 'last' in ccollab commands

Hi



I've written a script to automatically create a code review, which is executed by a Perforce change-commit trigger.



Within this script I'm using the 'last' ccollab parameter to set the review author, attach the changelist and start the review.



My question is whether the 'last' parameter is safe to use from a 'concurrency' perspective ? ie if two different users submit changelists at the same time, is there a danger that the 'last' parameter will return the same value for both users ?



Regards

1 Reply

  • dubyaohdubya's avatar
    dubyaohdubya
    Occasional Contributor
    Separate invocations of `ccollab` can certainly have other invocations of `ccollab` that use the same configuration file between them so there is a concurrency concern.



    To avoid that, use `ccollab admin batch`. The value for `last` is consistent within each invocation, and you can put as many commands in a single batch-xml spec as you want.