init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?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";
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user