Skip to content

Commit 28232a8

Browse files
committed
optimize code
1 parent 444185f commit 28232a8

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/Driver/RedisDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct($config = [])
4545
$this->timeout = 5;
4646
$this->retrySeconds = 10;
4747
$this->handleTimeout = 10;
48-
$this->channel = make(ChannelConfig::class, ['channel' => $config['default']]);
48+
$this->channel = make(ChannelConfig::class, ['channel' => $config['default'] . ':queues']);
4949
}
5050

5151
private function initRedis()

src/Util/Logger.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static function instance(): \Monolog\Logger
2020
{
2121
if (!isset(self::$instance)) {
2222
$logger = new \Monolog\Logger('queue');
23-
$rotatingFileHandler = new RotatingFileHandler(dirname(__DIR__, 1) . '../../../../../runtime/logs/queue.log', 7);
23+
$rotatingFileHandler = new RotatingFileHandler(dirname(__DIR__, 1) . '/../../../../runtime/logs/queue.log', 7);
2424
$rotatingFileHandler->setFormatter(new LineFormatter("[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n", 'Y-m-d H:i:s.u'));
2525
$logger->pushHandler($rotatingFileHandler);
2626
$logger->pushHandler(new Logger());
@@ -35,10 +35,7 @@ public static function instance(): \Monolog\Logger
3535
*/
3636
public function isHandling(array $record): bool
3737
{
38-
// if (APP_DEBUG) {
39-
// return $record['level'] >= \Monolog\Logger::DEBUG;
40-
// }
41-
return $record['level'] >= \Monolog\Logger::INFO;
38+
return $record['level'] >= \Monolog\Logger::DEBUG;
4239
}
4340

4441
/**

0 commit comments

Comments
 (0)