-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command for cart pruning #1303
Add command for cart pruning #1303
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@ryanmitchell thanks for this. I think we need some documentation somewhere for this and also a test, as we don't want to make any mistakes with deleting carts. |
Yep sorry I meant to ask where you'd want the docs to go - I wasnt sure where it best fitted. |
It's a good point. I had started updated docs for this config area, I could do with merging what I've done so far. I'll review and get back to you. |
Do you think create 2 commands and a documentation to add the command into app console kernal gives more flexibility to control how frequent it should be called.
also the query should be optimized with cursor fetch or paginated, and wrapped in DB::transaction |
Any thoughts on this one? Im happy to add to the docs if you point me in the right direction. |
I would probably suggest adding something to https://docs.lunarphp.io/core/reference/carts.html |
Thanks @glennjacobs. I've added some docs now. |
This PR adds a command
lunar:prune:carts
and some new config params underlunar.cart.prune_tables
to determine how pruning should be carried out.I opted for using a pipeline for amending the query, as we ultimately always seem to end up there.
I've tried to default to some sensible settings (90 days, dont prune carts with orders associated).
If pruning is enabled we automatically add a daily task rather then needing the developer to do it.