Closed ma-zal closed 6 years ago
@ma-zal Thanks!
I added you as a collaborator to the github and npm repo's. Can you please pull this in and publish the new version?
Perfect, thanks! I will start working on it on Monday.
@ma-zal Thanks for getting that in. Looks great!
Hello. I improved the buffering algorithm. Because I believe this is the good way, I'm offering it to original
pm2-slack
as pull request. You are welcome to discuss about it, of course!Goals:
Implemented algorithm:
1) When new message comes, it is stored to buffer. Buffer starts to wait for interval
buffer_seconds
. 2) If any next messages comes in this interval, it will be also stored to buffer. Buffer will reset previous interval and starts to waiting for newbuffer_seconds
. 3) When no new message comes in intervalbuffer_seconds
, buffer sends the messages to Slack channel. 4) To prevent buffer infinite cycling (when new messages are still received from some application), the buffer will forcibly send the buffered messages afterbuffer_max_seconds
(default 60 seconds) interval.