@@ -304,18 +304,6 @@ class WhatsAppWebhook {
|
||||
} catch (Exception $e) {
|
||||
error_log('Failed to create notification: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// Try to publish a lightweight event to Redis so SSE/WebSocket listeners can be notified immediately
|
||||
try {
|
||||
if (extension_loaded('redis')) {
|
||||
$payload = json_encode(['type' => 'new_message', 'user_id' => $user['id'], 'message_id' => (int)$conversationId, 'created_at' => date('Y-m-d H:i:s')]);
|
||||
$r = new Redis();
|
||||
$r->connect('127.0.0.1');
|
||||
$r->publish('user_' . $user['id'], $payload);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log('[webhook] redis publish failed: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// Procesar con bot (protección contra excepciones externas)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user