craftcms / webhooks

Plugin for integrating Craft with Zapier and IFTTT.
https://plugins.craftcms.com/webhooks
MIT License
84 stars 12 forks source link

Any way to empty the webhook activity db table, or provide a limit? #32

Closed howells closed 4 years ago

howells commented 4 years ago

I just discovered that the webhook activity table is now enormous, but I can't find any way to empty it. Is there a way, without having to do it manually in the db, and as a follow up could there be a way to set the limit of the number of requests to store?

brandonkelly commented 4 years ago

Just released Webhooks 2.3.0, which adds a new “Clear” button to the top of the Activity page, which will clear out all completed requests.

howells commented 4 years ago

Great thanks

siebird commented 4 years ago

@brandonkelly thanks for adding this–just cleared out 3.5k+ rows. A purge setting would be nice either by a time period or by limiting the number of records.

KatieMFritz commented 3 years ago

I just tried the clear button in a local install, and it set all my webhooks to "pending" but they're still there. Version 2.3.2, Postgres.

Manually clearing the rows from the webhookrequests database table worked.

jishi commented 3 years ago

There is no index on the status field, meaning that when you have accumulated around 100k rows, that clear button will take minutes at least and actually choke the whole server...

I had to do a TRUNCATE TABLE webhookrequests to do it, and to even manage to use the database backup tool from admin, because it would spend ages to make the dump.

brandonkelly commented 3 years ago

@jishi Webhooks 2.4.0 is out now with an index on that status column, fixing that performance issue.