Conversation
tyronx
reviewed
Oct 19, 2023
| if(!empty($webhookurl)) | ||
| { | ||
| sendWebhook($webhookdata ,$webhookurl); | ||
| } |
Contributor
There was a problem hiding this comment.
this is not scalable - A POST request like that probably takes about a second. 100 webhooks = 100 seconds delay when saving a mod. That is even ignoring webhook urls that don't respond properly. Worst case this can completely break saving due to timeouts.
Suggestion:
- Make a new "webhookqueue" db table, insert an entry whenever a mod gets modified / a user gets mentioned
- Write a "cron-processwebhookqueue.php" that iterates over these webhooks via cronjob
- Make sure curl POST request timeout is below 3 seconds so you don't endlessly stall the queue with a few bad webhooks
- A webhook url that fails to respond to the POST request some 20 times should get disabled (and the user be notified with a line of text in the accountsettings.tpl)
Contributor
There was a problem hiding this comment.
Long term this probably also needs the capability to run multiple cron-processwebhookqueue.php in parallel
# Conflicts: # lib/assetimpl/releaseeditor.php # lib/config.php # lib/user.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds option to set discord webhooks to get notified for the following
Follow Webhook:
Mention Webhook