Find strategy for deleting old bells
Description
Goal is to rewrite two bell deletion methods into one and to make it claner and easier to maintain. This is mostly code from 2014. This also helps with getting closer to #9 (closed) as we want to get rid of model classes.
- It would be great to keep the dayspan as an int parameter. Let's say 7 days as it is right now.
- The
expiration
colum describes the next time when a bell needs to be updated. This method gets called via cronjob and doesn't need to be checked for deletion yet. - Please keep the number of deleted rows as it is returned via logfile. The return of the delete method does that for you.
- Goal is to have them in
MaintenanceGateway
and be called viaMaintenanceControl
whereself::info
puts the output to our logfile
Methods
Expiration:
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src%2FModules%2FBell%2FBellGateway.php#L27
MaintenanceControl.php
::deleteBells()
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src%2FModules%2FMaintenance%2FMaintenanceControl.php
MaintenanceModel.php
::listOldBellIds()
(model which we want to get rid of)
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src%2FModules%2FMaintenance%2FMaintenanceModel.php#L9
All bell types:
Used according to the database export
identifier | delete after | description |
---|---|---|
buddy- |
never? | friend request |
fairteiler- |
14 days? | new food-share-point wall post if following |
forum-post- |
? | new forum post in a thread a user is participating in |
new-fairteiler- |
never? | alert for bots about a new food-share-point proposal |
new-fs- |
never? | alert bots/ambs about new fs |
pass-fail- |
? | When creation of foodsaver pass fails |
store-request |
never? | store application to bieb if someone wants to join a store |
store-arequest- |
store request accepted | |
store-drequest- |
store request denied | |
store-wrequest- |
store request accepted on waiting list | |
store-fetch-unconfirmed- |
unconfirmed slots for pickups | |
store-new- |
new store created | |
store-time- |
never? | when the time changes in a store (maybe deprecated) |
store-wallpost- |
30 days? | bell if someone comments in a store |
blog-check- |
? | if a new blog entry is created, other admins can check |
Not used
identifier | delete after | description |
---|---|---|
fs-sleep |
? | A bell for bots to inform a user is set to sleeping mode |
Solution
Edited by -