Closed michal-tobiasz-wttech closed 2 years ago
This is a restriction of the way how AECU scripts are executed in the cloud:
As multiple AEM instances share the same repository scripts might be executed multiple times during the same deployment. Please make sure your scripts can handle this. Scripts with "always" selector might be executed at random times as cloud instances can be added/removed dynamically based on load.
Yes, you are right. I thought that this script was executed on the same author instance again. I have delved into logs and saw that the second execution was from a different author instance. It starting to be really tricky now :)
True. Hopefully, Adobe supports install hooks again on AEM cloud. The current solution makes it very difficult to run actions at a deployment.
I have noticed during deployment in AEM as a cloud service in the history that a script that is set to execute only once was executed a second time. Looking at execution times the first execution started at 08:43:25 but there is a second execution at 08:43:49. Because one of my scripts takes about 3 minutes to complete then the second execution started during the execution of this script and executed it again. The effect of that was the second execution failed because it wanted to remove the node which was removed by the first execution.
Is it possible to avoid second execution? I'm a bit worried that current behaviour can cause some race conditions in script execution and unexpected results in scripts.