수정 본

This commit is contained in:
2026-03-10 18:57:09 +09:00
parent 13dfb3e112
commit 9650707caf
11 changed files with 2701 additions and 964 deletions

View File

@@ -40,16 +40,20 @@ class NaverWorker extends BaseCommand
while (true) {
// 1. DB 연결 상태 체크 (더 견고하게)
// 1. DB 연결 상태 체크
try {
// connID가 없거나, 가벼운 쿼리 실행 실패 시 재연결 시도
if ($this->db->connID === false || !$this->db->simpleQuery('SELECT 1')) {
// 연결이 없으면 재연결 시도
if ($this->db->connID === false) {
$this->db->reconnect();
CLI::write(CLI::color('🔄 Database reconnected.', 'yellow'));
}
} catch (\Throwable $e) {
// 어떤 이유로든 에러 발생 시 재연결 시도
$this->db->reconnect();
try {
$this->db->reconnect();
} catch (\Throwable $reconnectError) {
CLI::write(CLI::color('❌ Database reconnect failed: ' . $reconnectError->getMessage(), 'red'));
}
}
$result = $redis->brPop(['naver:raw_queue'], 30);