When I try to get full history from several hundreds channels memory size is increase infinitely. And I will get error in some hours. I check this on 3.0.6 and 3.2.11.
This is example of my code which is not save results in any array but size of application in my case increase to 2GB in some hours. Could you please help?
Hi!
When I try to get full history from several hundreds channels memory size is increase infinitely. And I will get error in some hours. I check this on 3.0.6 and 3.2.11.
This is example of my code which is not save results in any array but size of application in my case increase to 2GB in some hours. Could you please help?
`'use stricts'
const sleep = require('system-sleep'); const { MTProto } = require('telegram-mtproto') const { Storage } = require('mtproto-storage-fs')
const server = { dev: false }
const api = { layer: 57, initConnection: 0x69796de9, api_id: 49631 }
const client = new MTProto({ server, api, app: { storage: new Storage('storage') } });
async function parse(channel, offsetId, client) { const options = { peer: { _: 'inputPeerChannel', channel_id: channel.id, access_hash: channel.access_hash }, limit: 100 };
if (offsetId) { options.offset_id = offsetId; }
return client('messages.getHistory', options); }
async function parseChannel(channel, client) { let offsetId;
do { const res = await parse(channel, offsetId, client);
} while (true) }
async function main() { const channels = []; // some long array with channels
for (const i in channels) { await parseChannel(channels[i], client); } }
main();`