limit the number of revision #917
Answered
by
pboivin
xinyou-app
asked this question in
Q&A
|
to avoid the database grown faster, Isn't able to set the limited revision for each item? |
Answered by
pboivin
May 20, 2021
Replies: 3 comments 1 reply
|
Hi @xinyou-app, I don't know if there's a better way to do it, but here's a quick example to limit the number of revisions for a given module. You can add the following to your module repository : This was not tested extensively but I hope it can be helpful! |
1 reply
Answer selected by
xinyou-app
|
Great suggestion @pboi20! That operation can also be pushed to a queue to avoid any slowdown on save. Another option would be to schedule an artisan command. |
0 replies
|
It would be great to have this functionality in the core of Twill and be able to control it via the config. 'max_revisions' => 10, // default: false |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @xinyou-app,
I don't know if there's a better way to do it, but here's a quick example to limit the number of revisions for a given module. You can add the following to your module repository :
This was not tested extensively but I hope it can be helpful!