Why does my observer not run instantly?


#1

Sorry if this is a noob question, but…

I have a setup where I have a meteor app running on one Digital Ocean box, and on another Digital Ocean box I have another Meteor app that has been given the same MONGO_URL as the first app.

There is no UI (to speak of) in this second Meteor app and it does nothing except observe a collection and run a job anytime a document is added to, deleted from, or modified in the collection.

It appears, however, that it always takes several seconds for this observer to start running. I’m wondering why I can’t get it to run instantly.

The MongoDB I am using is one that I installed myself on the first DO box – does this homegrown approach prevent oplog tailing, or something like that?

Thanks.


#2

It sounds like the issue is with the initial startup of the observer? If so, observers call added for everything in the query when they are first run, so if you have enough items in the collection that could be the issue. If that’s not the issue, you will probably need to give some more details, ie a code sample.