Created
March 2, 2018 23:04
-
-
Save itoonx/5716a9acac354b1dd0a6541eae3eb647 to your computer and use it in GitHub Desktop.
Example for handle job to every 5 minute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Jobs; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Queue\InteractsWithQueue; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Foundation\Bus\Dispatchable; | |
use Carbon\Carbon; | |
use App\Jobs\Syncing; | |
use Log; | |
class Syncing implements ShouldQueue | |
{ | |
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | |
/** | |
* Create a new job instance. | |
* | |
* @return void | |
*/ | |
public function __construct() | |
{ | |
// | |
} | |
/** | |
* Execute the job. | |
* | |
* @return void | |
*/ | |
public function handle() | |
{ | |
$balance_a = app('App\Http\Controllers\WalletController')->CheckConfirm("BTC"); | |
$balance_b = app('App\Http\Controllers\WalletController')->sync("BTC"); | |
$balance_c = app('App\Http\Controllers\WalletController')->CheckConfirm("BCH"); | |
$balance_d = app('App\Http\Controllers\WalletController')->sync("BCH"); | |
Syncing::dispatch()->delay(Carbon::now()->addSeconds(5)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment