value)->count(); if($check_datasource > 0){ return $this->resError("Failed to execute while processing another scraping"); } // use ole schema synchronization // dispatch(new SyncronizeSIMBG()); // use new schema synchronization dispatch(new ScrapingDataJob()); return $this->resSuccess(["message" => "Success execute scraping service on background, check status for more"]); } public function retry_syncjob(string $import_datasource_id){ try{ $import_datasource = ImportDatasource::find($import_datasource_id); if(!$import_datasource){ return $this->resError("Invalid import datasource id", null, 404); } dispatch(new RetrySyncronizeJob($import_datasource->id)); return response()->json([ "success" => true, "message" => "Retrying scrape job on background, check status for more" ]); }catch(\Exception $e){ return response()->json([ "success" => false, "message" => "Failed to retry sync job", "error" => $e->getMessage() ]); } } }