Help with setInterval executed in


try to execute the following, located on the server side“bucle”)

bucle: function() {
mySandwich(function (con) {
var x = 0,
y = 0,
z = 0;
setInterval(function() {
if (x < con.length){
mySandwich2(con[x].woeid,function(td) {‘statuses/update’, {status: td }, function(error, data,response){
}, 9000)

when I logging on twitter and execute the call works, but if I logging with a different account and invoke the call from another web client, stops execution of the setInterval he was doing and run the new invoking, that happens or I am doing wrong? I run several setInterval invoking the call


Just a thought: did your try Meteor.setInterval instead of setInterval?


i try with Meteor.setInterval but but I have the following error.

Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.

at Object.Meteor.nodeCodeMustBeInFiber (packages/meteor/dynamics_nodejs.js:9:1)
at [object Object].
.extend.get (packages/meteor/dynamics_nodejs.js:21:1)
at withoutInvocation (packages/meteor/timers.js:4:1)
at bindAndCatch (packages/meteor/timers.js:13:1)
at Object._.extend.setInterval (packages/meteor/timers.js:40:1)
at trendmedia.js:182:26
at [object Object]._onTimeout (trendmedia.js:283:30)
at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)


Meteor does not allow use async function in server side. You need use Meteor.wrapAsync to wrap this to be a sync func:'statuses/update', { status: td }, function(error, data, response) {
    if (!error) {
        y = 0;
    } else {
        y = 0;


It does, in a manner of speaking.

const Future = Npm.require('fibers/future');
  doTheThing: function (waitTime) {
    let future = new Future();
    Meteor.setTimeout(future.return, 50000);
    return future.wait();


meteor.setinterval to make the change but the problem that opened this post I still happening