خرید بک لینک

Vote count: 0

I try to copy many records from Firebird to MongoDB. This is my function;

var queue = 0;
coection.sequentially(sql, (row) => {
    queue++;
    collection.insert(row, (err, result) => {
        if (err)
            retu done(err);
        queue--;
        if (queue <= 0)
          retu done(null, result);
    });
}, (err) => {
    coection.detach();
    done(err);
}

My problem is memory. Write operations are slower and after approx 100000 reads is my memory full. Is it possible to delay next read until the value of queue goes down under some level?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 31 ارديبهشت 1395 ساعت: 12:15

صفحه بندی