File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ private function handleSingleChildProcesses(): void
6969 $ currentPage = 1 ;
7070 $ childProcessCounter = 0 ;
7171 $ totalPages = $ this ->itemProvider ->getTotalPages ();
72+ if ($ totalPages <= 0 ) {
73+ $ this ->logger ->info ('There is nothing to process ' );
74+ $ this ->running = false ;
75+ return ;
76+ }
7277
7378 while ($ currentPage <= $ totalPages ) {
7479 // create fork
@@ -107,6 +112,11 @@ private function handleMultipleChildProcesses(): void
107112 $ childProcessCounter = 0 ;
108113 $ childPids = [];
109114 $ totalPages = $ this ->itemProvider ->getTotalPages ();
115+ if ($ totalPages <= 0 ) {
116+ $ this ->logger ->info ('There is nothing to process ' );
117+ $ this ->running = false ;
118+ return ;
119+ }
110120
111121 while ($ currentPage <= $ totalPages ) {
112122 // manage children
Original file line number Diff line number Diff line change 22 "name" : " zepgram/module-multi-threading" ,
33 "description" : " This module is a powerful tool for developers who want to process large data sets in a short amount of time" ,
44 "type" : " magento2-module" ,
5- "version" : " 0.1.4 " ,
5+ "version" : " 0.1.5 " ,
66 "authors" : [
77 {
88 "name" : " Benjamin Calef" ,
You can’t perform that action at this time.
0 commit comments