File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,15 @@ public function run()
7676 try {
7777 if ($ this ->blocking ) {
7878 $ data = Container::instance ()->delayqueue ->bpop ($ this ->topics ,$ this ->interval );
79- Container::instance ()->logger ->info (sprintf ('blocking with timeout of %d ' ,$ this ->interval ));
79+ if (empty ($ data )){
80+ Container::instance ()->logger ->info (sprintf ('blocking with timeout of %d ' ,$ this ->interval ));
81+ }
8082 } else {
8183 $ data = Container::instance ()->delayqueue ->pop ($ this ->topics );
82- sleep ($ this ->interval );
83- Container::instance ()->logger ->info (sprintf ('sleeping with timeout of %d ' ,$ this ->interval ));
84+ if (empty ($ data )){
85+ sleep ($ this ->interval );
86+ Container::instance ()->logger ->info (sprintf ('sleeping with timeout of %d ' ,$ this ->interval ));
87+ }
8488 }
8589
8690 } catch (\Exception $ exception ) {
You can’t perform that action at this time.
0 commit comments