51336e346a
Daily logs created by root cron were blocking www from appending, which aborted webhook ingest and bot pushes. File channels now use 0664 plus exception-safe stacks, and writes go through SafeLog. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
903 B
PHP
35 lines
903 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Services\TelegramNotifier;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
|
|
class SendTelegramMessage implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public int $tries = 3;
|
|
|
|
public int $timeout = 20;
|
|
|
|
public function __construct(
|
|
public string $chatId,
|
|
public string $text,
|
|
public ?string $token = null,
|
|
) {}
|
|
|
|
public function handle(TelegramNotifier $telegram): void
|
|
{
|
|
$result = $telegram->sendToChat($this->chatId, $this->text, $this->token);
|
|
if (! $result['ok']) {
|
|
\App\Support\SafeLog::channel('telegram')->warning('SendTelegramMessage job failed', [
|
|
'chat_id' => $this->chatId,
|
|
'error' => $result['error'] ?? 'unknown',
|
|
'text_preview' => mb_substr($this->text, 0, 80),
|
|
]);
|
|
}
|
|
}
|
|
}
|