Skip to content

Commit c4f68fe

Browse files
committed
Fix command
1 parent 3a6e10b commit c4f68fe

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

app/Console/Commands/BlockCommand.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?php
22
namespace App\Console\Commands;
33

4+
use DateTime;
5+
use DateTimeZone;
6+
use Exception;
7+
use InvalidArgumentException;
8+
use PDO;
9+
use RedisException;
10+
use Throwable;
11+
412
use App\Models\Address;
513
use App\Models\Block;
6-
714
use App\Models\Claim;
815
use App\Models\ClaimStream;
916
use App\Models\Input;
1017
use App\Models\Output;
1118
use App\Models\Transaction;
12-
use Carbon\Carbon;
13-
use DateTime;
14-
use DateTimeZone;
15-
use Exception;
19+
1620
use Illuminate\Console\Command;
1721
use Illuminate\Support\Facades\Cache;
18-
1922
use Illuminate\Support\Facades\DB;
2023
use Illuminate\Support\Facades\Redis;
21-
use InvalidArgumentException;
24+
2225
use Mdanter\Ecc\EccFactory;
23-
use PDO;
24-
use RedisException;
25-
use Throwable;
2626

2727
class BlockCommand extends Command{
2828

@@ -47,16 +47,13 @@ class BlockCommand extends Command{
4747
*/
4848
protected $signature = 'explorer:block {function?}';
4949

50-
public function __construct(){
51-
parent::__construct();
52-
self::$redis = Redis::connection()->client();
53-
self::$rpcurl = config('lbry.rpc_url');
54-
}
55-
5650
/**
5751
* Execute the console command.
5852
*/
5953
public function handle(): void{
54+
self::$redis = Redis::connection()->client();
55+
self::$rpcurl = config('lbry.rpc_url');
56+
6057
$function = $this->argument('function');
6158
if($function){
6259
$this->$function();
@@ -1131,7 +1128,6 @@ public function parsenewblocks(): void{
11311128
self::lock('parsenewblocks');
11321129

11331130
echo "Parsing new blocks...\n";
1134-
self::$redis = Redis::connection()->client();
11351131
try {
11361132
// Get the best block hash
11371133
$req = ['method' => 'getbestblockhash', 'params' => [],'id'=>rand()];

0 commit comments

Comments
 (0)