阅读背景:

使用sidekiq只执行许多重复作业中的一个?

来源:互联网 

I have a background job that does a map/reduce job on MongoDB. When the user sends in more data to the document, it kicks of the background job that runs on the document. If the user sends in multiple requests, it will kick off multiple background jobs for the same document, but only one really needs to run. Is there a way I can prevent multiple duplicate instances? I was thinking of creating a queue for each document and making sure it is empty before I submit a new job. Or perhaps I can set a job id somehow that is the same as my document id, and check that none exists before submitting it?I have a background job that does a map/reduce




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: