GearmanBundle icon indicating copy to clipboard operation
GearmanBundle copied to clipboard

Cli features

Open clafouti2104 opened this issue 11 years ago • 6 comments

Hello,

Is there a way to get the queue length? Indeed, I run the method doBackgroundJob when I want to execute an action but I got a problem if the worker isn't launched : my queue increases without any reason. So I'd like to know the queue length in order to avoid useless doBackgroundJob.

Thanks for the answer

clafouti2104 avatar Mar 12 '13 15:03 clafouti2104

nc <hostname> 4730 status

bmeynell avatar Mar 13 '13 16:03 bmeynell

Or write a script to do that, or use a persistent store (sqlite, drizzle, etc.) and do a count on the number of rows.

bmeynell avatar Mar 13 '13 16:03 bmeynell

thanks for the comment, I got another question: when I run

nc localhost 4730
status

I got something like this

 worker ~ function 184 0   0

Is there a way or command to reset the queue?

clafouti2104 avatar Mar 15 '13 07:03 clafouti2104

"184" is number of jobs queued, "0" is number of jobs processing, the final "0" is number of workers connected that can process that job.

To clear the queue, you can just restart gearmand.

There's also a 'gearman' command you can install (e.g., on ubuntu) that provides some utilities.

bmeynell avatar Mar 15 '13 13:03 bmeynell

Leaving this open as things like this could make for a handy CLI tool.

bmeynell avatar May 08 '13 02:05 bmeynell

Could be nice, with this new version, add some new cli features.

Any ideas?

mmoreram avatar Aug 31 '13 17:08 mmoreram