storing analytics data
This commit is contained in:
@@ -50,6 +50,18 @@ final class FollowService
|
||||
$this->incrementCounter($targetId, 'followers_count');
|
||||
});
|
||||
|
||||
// Record activity event outside the transaction to avoid deadlocks
|
||||
if ($inserted) {
|
||||
try {
|
||||
\App\Models\ActivityEvent::record(
|
||||
actorId: $actorId,
|
||||
type: \App\Models\ActivityEvent::TYPE_FOLLOW,
|
||||
targetType: \App\Models\ActivityEvent::TARGET_USER,
|
||||
targetId: $targetId,
|
||||
);
|
||||
} catch (\Throwable) {}
|
||||
}
|
||||
|
||||
return $inserted;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user