how to limit the number of times a flow can be executed in a certain range of time
Posted: 29 Jul 2020 23:07
Is there an easy way to limit how many times the same flow can be executed in a range of time?
Use case: a trigger can be my screen turning on to get data from an API. But I don't want to be getting data from the API too often so the flow could be stopped if I noticed that the flow ran in less than 10m ago. This way also if I don't check my phone all day I won't be getting data from the API which is good for this case.
I've tried execution count from here https://automagic4android.com/condition ... nt_en.html
but it seems to do other thing for me
Following my use case, execution count will count the number of times I turned on my screen in a certain range of time. But I just need a way to see if I did the flow some time ago. Maybe I didn't understand it correctly?
What I can also do is to set a boolean global variable to true when running the flow and then set a timer for 10m to toggle it back to false/null. And check for that variable at the start of my flow. But I want to do this for so many flows and it takes time and creates global variables :/
Any ideas?
Use case: a trigger can be my screen turning on to get data from an API. But I don't want to be getting data from the API too often so the flow could be stopped if I noticed that the flow ran in less than 10m ago. This way also if I don't check my phone all day I won't be getting data from the API which is good for this case.
I've tried execution count from here https://automagic4android.com/condition ... nt_en.html
but it seems to do other thing for me
Following my use case, execution count will count the number of times I turned on my screen in a certain range of time. But I just need a way to see if I did the flow some time ago. Maybe I didn't understand it correctly?
What I can also do is to set a boolean global variable to true when running the flow and then set a timer for 10m to toggle it back to false/null. And check for that variable at the start of my flow. But I want to do this for so many flows and it takes time and creates global variables :/
Any ideas?