<?php

namespace App\Console\Commands\Network;

use App\Console\Commands\BaseCommand;

class GoliathWithdraw extends BaseCommand
{

    protected $signature = 'goliath:withdraw';

    protected $description = 'Runs the inlining process for Goliath';

    public function handle()
    {
        $start = microtime(true);

        $base = base_path();

        $pipe = popen("python3 $base/app/Bin/GoliathRibUpdate.py --level=1", 'w');
            
        pclose($pipe);

        if(($time_taken = microtime(true) - $start) && $time_taken > 10) {
            \Log::debug("Inlining execution has exceeded safe time: $time_taken");
        }

        return 0;
    }
}