Sorry for bring up the this old post again, but I found this really useful.
The table is lacking a timestamp field.
[code]
Update
ALTER TABLE `gearman_queue` ADD COLUMN `Added` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `when_to_run`;
Remove
ALTER TABLE `gearman_queue` DROP COLUMN `Added`;
original
CREATE TABLE `gearman_queue` (
`unique_key` varchar(64) DEFAULT NULL,
`function_name` varchar(255) DEFAULT NULL,
`priority` int(11) DEFAULT NULL,
`data` longblob,
`when_to_run` int(11) DEFAULT NULL,
UNIQUE KEY `unique_key` (`unique_key`,`function_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
[/code]
[code]
select count(*) from gearman.gearman_queue where Added < DATE_SUB(NOW(),INTERVAL 60 minute)
[/code]