Closed ztipnis closed 5 years ago
Have a web API using node/express which fetches data from an IMAP server. Each request follows the form:
imap.connect().then(async () => { await imap.[command[ res.end([response]); await imap.destroy() });
imap.destroy:
async destroy(){ await this.client.logout(); await this.client.close(); this.client = undefined; }
this.client is an instance of ImapClient which is created during the constructor for the object.
After a few calls to the API I get:
Could not connect to server Error: Too many simultaneous connections.
The client is not waiting to terminate the connection and the IMAP roundtrip takes a while. So if you're running them without a pause, that's the reason why it does not work.
Have a web API using node/express which fetches data from an IMAP server. Each request follows the form:
imap.destroy:
this.client is an instance of ImapClient which is created during the constructor for the object.
After a few calls to the API I get:
Could not connect to server Error: Too many simultaneous connections.