문제

I have to develop an API which does some map reduce jobs in the background and then return the results. Its a sinatra application with a Riak No-sql database. The issue is that the job takes around 5-10 minutes to run. And the request times out in that amount of time. What can be the best ways to run such kind of jobs in the background?

도움이 되었습니까?

해결책

Something like DelayedJob with a layer of something like Redis over the top (to keep track of job state), that is accessed by a unique route (your Sinatra API). Then have a different page (the web page for browser clients) that calls the API via AJAX, polling it periodically.

다른 팁

you can use the operation system scheduler

windows task scheduler

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