Forum Discussion

jacques_ca's avatar
4 years ago

Wait And Sleep in Freemarker

Hi

 

Is there a function wait/sleep/setTimeOut in Freemarker that we can use before executing anything? I made a search in Freemarker site, Google, Stackoverflow and I don't see anything.

  • I don't think Freemarker has this built-in.

    What is your exact user case? Maybe some Javascript can help?

    Or use an endpoint to poke a AWS lambda node.js function. Inside the lambda function you can do a wait. Then you can config eg. 5 seconds for the lambda function to return. Then your httpclient in freemarker can continue execute after 5ish seconds. LOL

  • I don't think Freemarker has this built-in.

    What is your exact user case? Maybe some Javascript can help?

    Or use an endpoint to poke a AWS lambda node.js function. Inside the lambda function you can do a wait. Then you can config eg. 5 seconds for the lambda function to return. Then your httpclient in freemarker can continue execute after 5ish seconds. LOL

    • jacques_ca's avatar
      jacques_ca
      Maven

      Thanks Peter!

       

      It is for an endpoint on khoros. We initiate an ajax call to an endpoint via a js file. Inside the endpoint, we make api call to S3. On failure, we retry the call. Knowing that it could be due to a server error, we prefer to space them every x seconds. 

      You are right. We can use lambda function for that instead. It is an option I haven't explored yet. Thanks