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:
@@ -111,6 +111,8 @@ try {
|
||||
$dependencyModel = new DependencyModel($conn);
|
||||
$dependencyModel->addDependency($result['ticket_id'], $sourceTicketId, 'relates_to', $userId);
|
||||
|
||||
require_once dirname(__DIR__) . '/models/StatsModel.php';
|
||||
(new StatsModel($conn))->invalidateCache();
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'new_ticket_id' => $result['ticket_id'],
|
||||
|
||||
Reference in New Issue
Block a user