Been using a successful piston for a while now to grab Octopus Agile API results - however the last two days they’ve been late releasing the data, so my timer which runs at 5pm didn’t work as the data wasn’t out by then.
I decided to run a check and if the data wasn’t available, keep checking every 5 minutes until it is. I thought a loop would be correct for this but when i put the “wait in” it seems to run the entire piston again from the start instead of just the loop - so is there a correct way to do this?
So to explain the piston - for the purposes of testing i’ve just used 1 minute pause but to save hits on the server i’d probably set this to 10 minutes.
So the piston runs at a set time - first it checks the URL and sets the result in a variable.
Next we check the variable, if it’s higher than 15 it means the API hasn’t updated, so I want to enter the loop to keep checking until the result is lower than 15 and it can run the rest of the commands in the piston.
At the moment if it’s lower than 15 at the start, it works with no problem, however when it enters the loop it seems to run the loop and I assume it’s getting to wait bit each time and getting stuck there. If I put wait at the end how would i exit the loop at all once the desire outcome is reached? I assume there’s a proper way to do this and not just have it loops really fast as quickly as it can process?