Scheduled jobs failing (again) (again 😥) (Ongoing Known Issue)

For the third consecutive week, my periodic history download SmartApp failed to execute.
The only difference is that this time, running it by hand from the IDE, I got an “error” notification in the log :

java.util.concurrent.TimeoutException: Execution time exceeded 20 app execution seconds: 122413839485071 @ line 112

which resulted in the usual IDE return code :

java.lang.reflect.UndeclaredThrowableException @ line 112

I wonder if somehow, the way I wrote my lines 111-112 in my “JJ’s Test2” SmartApp does not result in parallel threads competiting for the same DB access, and when not getting through, then going into time-out.

111    for (tempSens in temperatureSensors) {
112        def allEvents = tempSens.eventsBetween(startDate, endDate, [max:2000]).findAll{it.name == "temperature"}

But if it is the case, how can I modify my code to force serial execution and avoid this concurrent.TimeoutException ?
Sorry if it is a dumb question, but Java/Groovy is not my forte… :frowning:

But obviously, this yet does not explain why the same code ran without this problem for 2 years, and systematically fails to execute since 3 weeks; somebody at SmartThings must have done (or not done) something…