L
L
lynnikvadim2015-09-08 13:20:33
Laravel
lynnikvadim, 2015-09-08 13:20:33

How to increase the waiting time?

When using the script:

public function createCat(Request $request)
  {
     
    if(($request->file('files'))) {		
          $Category = new Category();				
          $files=$request->file('files');
          $name=$files->getClientOriginalName();
          $filename=date('Y-m-d-H:i:s')."-".$files->getClientOriginalName();					
          $path='upload/xls/';
          $files->move($path,$filename);
          $ffile='upload/xls/'.$filename;
           
           
          $results=Excel::selectSheets('Категории')->load($ffile)->get(); 
          foreach ($results as $row) {
            Category::create([
            'post'=>$row->post,
            'name'=>$row->name,
            'numer'=>$row->numer, ]);}
          $resultsCat=Excel::selectSheets('Под_категории')->load($ffile)->get(); 
            foreach ($resultsCat as $row) {
            podcat::create([
            'post'=>$row->post,
            'name'=>$row->name,
            'numer'=>$row->numer, ]);}

          Flash::success('Данные загружены');
          return redirect('admin/upload');
        } else {
          Flash::success('Вы не выбрали фаил.');
          return redirect('admin/upload');
        }
  }

and package https://github.com/Maatwebsite/Laravel-Excel
There are more than 800 entries on the second sheet.
As a result, the first sheet with 30 records is written to the database.
There is no second sheet.
If there are 50 entries on the second sheet, then it is recorded.
What could be the problem ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Plisko, 2015-09-08
@lynnikvadim

Use queues, the user does not have to wait for a response, let it run in the background.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question