codeigniter4 / queue

Queues for the CodeIgniter 4 framework
https://queue.codeigniter.com/
MIT License
44 stars 12 forks source link

refactor: fix type inconsistency #11

Closed kenjis closed 8 months ago

kenjis commented 9 months ago

Needs #10

Description

Checklist:

michalsn commented 9 months ago

Good catch. Thanks.

kenjis commented 9 months ago

It seems the remaining errors are bugs or API inconsistency.

 ------ ----------------------------------------------------------------------------------------- 
  Line   src/Commands/QueueWork.php                                                               
 ------ ----------------------------------------------------------------------------------------- 
  195    Call to an undefined method CodeIgniter\Queue\Interfaces\JobInterface::getTries().       
  197    Call to an undefined method CodeIgniter\Queue\Interfaces\JobInterface::getRetryAfter().  
 ------ ----------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------- 
  Line   src/Handlers/BaseHandler.php                                                               
 ------ ------------------------------------------------------------------------------------------- 
  59     Call to an undefined method CodeIgniter\Queue\Handlers\BaseHandler::push().                
  72     Call to an undefined method CodeIgniter\Queue\Models\QueueJobFailedModel::affectedRows().  
  84     Call to an undefined method CodeIgniter\Queue\Models\QueueJobFailedModel::truncate().      
 ------ ------------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------- 
  Line   src/Handlers/PredisHandler.php                                                           
 ------ ----------------------------------------------------------------------------------------- 
  97     Parameter #2 $fields of method Predis\ClientInterface::hdel() expects array, int given.  
  112    Parameter #2 $fields of method Predis\ClientInterface::hdel() expects array, int given.  
  125    Parameter #2 $fields of method Predis\ClientInterface::hdel() expects array, int given.  
 ------ ----------------------------------------------------------------------------------------- 
michalsn commented 9 months ago

Thanks!

Seems like QueueJobFailedModel::affectedRows() and QueueJobFailedModel::truncate() are fine, the rest is fixed in #12.

kenjis commented 9 months ago

I don't understand the code well, but is that model unrelated to Redis?

And you created #12, so can I close this PR?

michalsn commented 9 months ago

I don't understand the code well, but is that model unrelated to Redis?

No. Failed jobs are always stored in the "traditional" database.

And you created https://github.com/codeigniter4/queue/pull/12, so can I close this PR?

Yes, however, please don't remove the branch yet - just in case.