문제

I have a Gearman Work in php that processes background tasks from client. From time to time I am not able to process that job. I would need a way to delay retry that job after 5 minutes. How can I do that?

What I do now is to do exit(255) but this will retry the job immediately. Also I do not know how can I get the number of failures of that specific job (in the worker).

Questions:

  1. How can I do the above stuff in Gearmand
  2. Is there any other messageing system that is capable of this?
도움이 되었습니까?

해결책

You can't. At least not using built-in capabilities. This feature is only partly implemented in Gearmand and the PHP module does not expose this functionality. See this discussion on the feature.

People have tried different things, including:

When it comes to tracking failures - again, you can't, AFAIK. See my answer on handling retries in Gearman for a possible solution.

다른 팁

Not build in, but you can use a bit of memcached+TTL for that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top