Timer in inbound action

nirwan_ritik
Tera Contributor

 

I have an inbound action where I want to deploy a 30 min timer for my code to run (and create a Incident) once the system receives the email.

Will this block of code help me achieve my requirement?
Does is contain any bug or has performance issue?

    var secondsValue = 60; // 1min
    var seconds = parseInt(secondsValue, 10) * 30000;
    var start = parseInt(new Date().getTime()) + seconds;
    while (start > parseInt(new Date().getTime())) {
        // pass
    } 
    ............. // my code ahead for creating the incident

Thanks in advance
1 ACCEPTED SOLUTION

Peter Bodelier
Giga Sage

Hi @nirwan_ritik,

I think I already gave the answer in your other thread?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

3 REPLIES 3

Peter Bodelier
Giga Sage

Hi @nirwan_ritik,

I think I already gave the answer in your other thread?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Pardon me. This was posted before your reply 🙂
Thanks again

No problem. Can you accept the answer, so this thread is closed?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.