<?php
namespace app\process\getcoin;

use Workerman\Crontab\Crontab;
use app\command\GetcoinBitget;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;

class Bitget
{
    public function onWorkerStart()
    {
        new Crontab(env_get('getcoin.bitget.time','0 */30 * * * *'), function(){
            echo "===================================\n";
            echo date('[Y-m-d H:i:s]')."Getcoin:".__CLASS__." Now Running: \n";
            $command = new GetcoinBitget();
            $input = new ArrayInput([
                'name' => 'Alice',
            ]);
            $output = new ConsoleOutput();
            $command->run($input, $output);
            echo "===================================\n";
        });

    }
}