fix syncronize using worker and add duration syncronize
This commit is contained in:
@@ -4,9 +4,15 @@ namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Enums\ImportDatasourceStatus;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Jobs\ScrapingDataJob;
|
||||
use App\Jobs\SyncronizeSIMBG;
|
||||
use App\Models\ImportDatasource;
|
||||
use App\Traits\GlobalApiResponse;
|
||||
use App\Services\ServiceTokenSIMBG;
|
||||
use GuzzleHttp\Client;
|
||||
use App\Services\ServiceGoogleSheet;
|
||||
use App\Services\ServicePbgTask;
|
||||
use App\Services\ServiceTabPbgTask;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -23,8 +29,11 @@ class ScrapingController extends Controller
|
||||
return $this->resError("Failed to execute while processing another scraping");
|
||||
}
|
||||
|
||||
// use ole schema synchronization
|
||||
// dispatch(new SyncronizeSIMBG());
|
||||
Artisan::call("app:scraping-data");
|
||||
|
||||
// use new schema synchronization
|
||||
dispatch(new ScrapingDataJob());
|
||||
return $this->resSuccess(["message" => "Success execute scraping service on background, check status for more"]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user