正確輸入所有數(shù)據(jù)后如何結束我的異步連接?即使在循環(huán)外聲明連接結束,結構也在第一次 INSERT 之后完成代碼require('es6-promise').polyfill();require('isomorphic-fetch');let queryAPI = { "query": `{ squads { name cards(includedOnKanban: true, closed: false, archived: false, cancelled: false, swimlaneName:\"Atividades Nao Transacionais\", updatedSince: \"2020-01-01T00:00:00-0300\") { identifier title description status priority assignees { fullname email } swimlane workstate } } }`};(async () => { const rawResponse = await fetch('https://www.bluesight.io/graphql', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Bluesight-API-Token': 'token-here' }, body: JSON.stringify(queryAPI) }); const content = await rawResponse.json(); const { Client } = require('pg'); const client = new Client({ user: 'postgres', host: '127.0.0.1', database: 'postgres', password: 'postgres', port: 5432 })輸出錯誤:連接在連接處終止。(C:\Users\TESTE\Documents\Autoportal\api\node_modules\pg\lib\client.js:254:9) 在 Object.onceWrapper (events.js:417:28) 在 Connection.emit (events.js: 323:22)
錯誤:連接終止 - ASYNC nodeJS
BIG陽
2022-05-22 17:35:15