代码之家  ›  专栏  ›  技术社区  ›  Amaldev

续集池相关问题

  •  0
  • Amaldev  · 技术社区  · 7 年前

    错误为“ 资源当前不在此池中 "

    使用的版本:

    2.0.0

    续集版本 4.1.0

    错误:

    Unhandled rejection Error: Resource not currently part of this pool
        at Pool.destroy (\node_modules\sequelize\node_modules\generic-pool\lib\Pool.js:450:35)
        at Connection.<anonymous> (\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:124:25)
        at emitOne (events.js:77:13)
        at Connection.emit (events.js:169:7)
        at Connection.socketError (\node_modules\tedious\lib\connection.js:703:14)
        at emitOne (events.js:77:13)
        at Socket.emit (events.js:169:7)
        at emitErrorNT (net.js:1257:8)
        at doNTCallback2 (node.js:441:9)
        at process._tickCallback (node.js:355:17)
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   malick    7 年前

    我有同样的错误,但它不会导致我的应用程序崩溃。所以我添加了这部分代码来处理它:

    const unhandledRejections = new Map();
    process.on('unhandledRejection', (reason, p) => {
        unhandledRejections.set(p, reason);
    });
    process.on('rejectionHandled', (p) => {
        unhandledRejections.delete(p);
    });