max-concurrency hook property support#167
Conversation
There was a problem hiding this comment.
It's an okay approach. Other one would be storing these executions in the hook object. Usage of channels is creative, but a simple integer property could be more memory efficient :-)
(Don't get me wrong, I don't want you to switch back from channels, let's go with this approach until the end. We'll optimize later if we hit performance/memory issues).
Needs a bit more work, but looking good overall.
|
Thanks for the feedback!
I think I've fixed all the issues you pointed out. I've also reduced nesting in Let me know if any other changes needed. |
|
Alright, I tried out some scenarios. This works perfect when the However, when that is not the case, For this to work properly, the With that in mind, few other things can bite us from the nature of concurrent executions:
|
|
Oh, that' right, just yesterday I was looking at this bit of code where |
|
Waiting on #175; if it works, I'll update this PR. |
|
@adnanh -- just an update on this one: I have updated the code in my repository with the assumption #175 is good and tested all the cases you mentioned. Everything seems good and rate limiting works as expected. When you get few spare minutes, could you review #175 and if it looks good, I'll update this PR with code that accounts for it. |
|
Hey, didn't forget about you, just busy with work and life. I will grab some time this week to review everything and hopefully merge it :-) |
|
Hey, I left you a comment on the #175 |
|
hello, do we have any plans to get this implemented? :D |
|
Hi, would also love this feature. It is pretty vital to my use case. (I'm trying to run gatsby build when changes happen on the CMS but as soon as there are a little bit more updates at once the webhook service gets oom-killed.) |
I have implemented support for hook concurrency limits (issue #148):
When the limit is reached, webhook will return
429 Too Many Requestserror and show error message:Let me know if you want it to be implemented differently.