Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getLoopCount() ? #16

Open
Fosnez opened this issue Nov 5, 2018 · 3 comments
Open

getLoopCount() ? #16

Fosnez opened this issue Nov 5, 2018 · 3 comments

Comments

@Fosnez
Copy link

Fosnez commented Nov 5, 2018

Is it by design, or just an oversight that there doesn't appear to be a way of seeing how many loops/recursions you are current in?

Would be useful to say "only run this on the outer most loop" etc.

Or have I missed the mark here?

@renatoliveira
Copy link
Contributor

You seem to be correct in this observation. The easiest way I can see to check the loop count is by accessing the loopCountMap static variable (which is private now).

If it were public, you could get the count using:

TriggerHandler.loopCountMap.get('handlerName').getCount();

If you want to, you might want to submit this as a new feature. If not, I might add this feature to my fork of the repository later.

@kevinohara80
Copy link
Owner

kevinohara80 commented Nov 6, 2018 via email

@renatoliveira
Copy link
Contributor

@kevinohara80 Please take a look at PR #13, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants