@@ -55,6 +55,7 @@ public function pushJobToQueue($job)
5555
5656 if ($ this ->db ->errors ()) {
5757 $ this ->errors = $ this ->db ->errors ();
58+
5859 return false ;
5960 }
6061
@@ -69,12 +70,13 @@ public function popJobFromQueue($id)
6970 $ this ->db
7071 ->delete ($ this ->config ['table ' ])
7172 ->where ([
72- "id " => $ id
73+ "id " => $ id,
7374 ])
7475 ->execute ();
7576
7677 if ($ this ->db ->errors ()) {
7778 $ this ->errors = $ this ->db ->errors ();
79+
7880 return false ;
7981 }
8082
@@ -89,15 +91,16 @@ public function setJobStatus($id, $status)
8991 $ this ->db
9092 ->update ($ this ->config ['table ' ])
9193 ->params ([
92- "status " => $ status
94+ "status " => $ status,
9395 ])
9496 ->where ([
95- "id " => $ id
97+ "id " => $ id,
9698 ])
9799 ->execute ();
98100
99101 if ($ this ->db ->errors ()) {
100102 $ this ->errors = $ this ->db ->errors ();
103+
101104 return false ;
102105 }
103106
@@ -112,15 +115,16 @@ public function markJobAsFailed($id)
112115 $ this ->db
113116 ->update ($ this ->config ['table ' ])
114117 ->params ([
115- "status " => "failed "
118+ "status " => "failed " ,
116119 ])
117120 ->where ([
118- "id " => $ id
121+ "id " => $ id,
119122 ])
120123 ->execute ();
121124
122125 if ($ this ->db ->errors ()) {
123126 $ this ->errors = $ this ->db ->errors ();
127+
124128 return false ;
125129 }
126130
@@ -141,7 +145,7 @@ protected function setupAdapterStorage()
141145 'retry_count ' => 'INT ' ,
142146 'created_at ' => 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP ' ,
143147 'updated_at ' => 'DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ' ,
144- 'PRIMARY KEY ' => '(ID) '
148+ 'PRIMARY KEY ' => '(ID) ' ,
145149 ])
146150 ->execute ();
147151 }
@@ -162,7 +166,7 @@ public function getNextJob()
162166 return $ this ->db
163167 ->select ($ this ->config ['table ' ])
164168 ->where ([
165- 'status ' => 'pending '
169+ 'status ' => 'pending ' ,
166170 ])
167171 ->orderBy ('id ' , 'asc ' )
168172 ->limit (1 )
@@ -178,15 +182,16 @@ public function retryFailedJob($id, $retryCount)
178182 ->update ($ this ->config ['table ' ])
179183 ->params ([
180184 "status " => "pending " ,
181- "retry_count " => (int ) $ retryCount + 1
185+ "retry_count " => (int ) $ retryCount + 1 ,
182186 ])
183187 ->where ([
184- "id " => $ id
188+ "id " => $ id,
185189 ])
186190 ->execute ();
187191
188192 if ($ this ->db ->errors ()) {
189193 $ this ->errors = $ this ->db ->errors ();
194+
190195 return false ;
191196 }
192197
0 commit comments