-1

i have a script that contains a token which it s must be refreshed every 10 min , so i add a fork and js to calculate the time spent between start time and end time . So i want to set the value calculated to a variable so that I can make a condition on this value after in my script to refresh my token . isi have a script that contains a token which it s must be refreshed every 10 min , so i add a fork and js to calculate the time spent between start time and end time . that possible ? if its not how can i do it to resend my request ?

1 Answers1

0

I think you actually don't need to calculate the time spent between start time and end time.

The fork action stop when the main thread stop. You just have to put an infinite loop in your fork with your refresh request and extract the token in this request. at the end of your userpath, the infinite loop will end automatically.

Camille Gerin-Roze
  • 4,271
  • 1
  • 11
  • 16