当调用findOne过多时,猫鼬findOne引发未知错误

时间:2019-05-28 15:21:26

标签: javascript node.js mongoose

Model.findOne({_id: offer._id}, function (err, doc) {
// Whatever
});

当我多次使用findOne(大约12000)时,会引发这样的错误:

> openssl config failed: error:02001003:system library:fopen:No such
> process events.js:167
>       throw er; // Unhandled 'error' event
>       ^
> 
> Error: read ECONNRESET
>     at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) Emitted 'error' event at:
>     at TLSSocket.socketErrorListener (_http_client.js:391:9)
>     at TLSSocket.emit (events.js:182:13)
>     at emitErrorNT (internal/streams/destroy.js:82:8)
>     at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
>     at process._tickCallback (internal/process/next_tick.js:63:19)

我不知道该如何处理该错误以及为什么会发生,Google的搜索无济于事。仅当我使用方法findOne时才会发生此错误。

0 个答案:

没有答案