Commit d736fd6c0c99cb998af56979b12ceab60ed101ee
- Diff rendering mode:
- inline
- side by side
htdocs/lib/activity.php
(8 / 1)
|   | |||
| 193 | 193 | $watchlist = activity_locate_typerecord('watchlist'); | |
| 194 | 194 | $viewsnotified = array(); | |
| 195 | 195 | foreach ($toprocess as $activity) { | |
| 196 | // Remove this activity from the queue to make sure we | ||
| 197 | // never send duplicate emails even if part of the | ||
| 198 | // activity handler fails for whatever reason | ||
| 199 | if (!delete_records('activity_queue', 'id', $activity->id)) { | ||
| 200 | log_warn("Unable to remove activity $activity->id from the queue. Skipping it."); | ||
| 201 | continue; | ||
| 202 | } | ||
| 203 | |||
| 196 | 204 | $data = unserialize($activity->data); | |
| 197 | 205 | if ($activity->type == $watchlist->id && !empty($data->view)) { | |
| 198 | 206 | if (isset($viewsnotified[$data->view])) { | |
| … | … | ||
| 220 | 220 | } | |
| 221 | 221 | db_commit(); | |
| 222 | 222 | } | |
| 223 | delete_records('activity_queue'); | ||
| 224 | 223 | } | |
| 225 | 224 | } | |
| 226 | 225 |

