For each loop not processing everything (bug?)

Answered

Hello, so I have a relatively simple task to reset the daily statistics for users, using a 'task' to do it and it was working well, but now there is about 3.5K of rows to edit and the loop is not processing everything.

Strangest part, and why I think it is a bug is that, it does not result in an error, but it does not process all the 3.5k rows either, just 700-800~ of them.

Now I have changed the return type from list to 'stream', but result stayed the same.

This is how the accounts_1 are returned, only the id in stream mode

This is what happens when I run this loop( 3.5k records should be processed):

Running it again instantly:

And again:

And after a couple more times it is finally done processing all the records, and there is nothing left = done:

So my question is, why are these 'for each' loops completing without processing all the records, and why sometimes it only picks up 100, and sometimes 1.5k records ๐Ÿ˜ฒ

Thank you!

4 replies