使用 Gearman,我可以检查作业失败了多少次吗?
使用 Gearman,我可以检查作业失败了多少次吗? 例如:如果一项工作失败,我希望它重复。如果作业失败 5 次,则将其删除。我必须使用哪个功能。
示例:如果我想排队从服务器下载文件。如果该服务器宕机,那么工作就无法完成。
With Gearman , can i check job failed how much times ?
example: if a job failed , i want it to repeat . if job failed 5 times then delete it. I must use which function.
example: if i want queue up to download file from a server. If that server is down, then job can't be finished .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之,不。您无法查询作业失败了多少次。
然而,该信息位于 gearmand 内部,但还没有 API 可以访问它。
我认为您正在寻找的选项是
-j, --job-retries
这是 gearmand 服务器在启动时采用的参数。它指定作业在被丢弃之前可以重试的次数。它是一个全局设置,不能针对不同的作业类型进行不同的配置。它也无法从 gearman 客户端进行设置或更改。
In short, no. You can't query how many times a job has failed.
However the information is there inside gearmand, but there is no API to access it yet.
I think the option you are looking for is
-j, --job-retries
This is an argument the gearmand server takes when starting. It specifies the number of times a job can be retried before being discarded. It is a global setting and cannot be configured to be different for different job types. It also cannot be set or changed from a gearman client.