Invalidate stats cache after any ticket-modifying API call
StatsModel::invalidateCache() was never called from any API, so the 60s cached stats persisted after bulk assign/status/priority changes, ticket updates, assignments, and clones. Dashboard tiles showed stale counts until the TTL expired. Added invalidation to the four APIs that affect dashboard stat tiles: - bulk_operation.php: after successful bulk assign/status/priority - assign_ticket.php: after successful reassignment - update_ticket.php: after any successful ticket update - clone_ticket.php: after successful clone (open_tickets changes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -270,7 +270,13 @@ try {
|
||||
|
||||
// Discard any output that might have been generated
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
// Invalidate stats cache on successful ticket update
|
||||
if (!empty($result['success'])) {
|
||||
require_once dirname(__DIR__) . '/models/StatsModel.php';
|
||||
(new StatsModel($conn))->invalidateCache();
|
||||
}
|
||||
|
||||
// Return response
|
||||
if (!empty($result['http_status'])) {
|
||||
http_response_code($result['http_status']);
|
||||
|
||||
Reference in New Issue
Block a user