Ridhwaan Shakeel
10/19/2022, 3:40 AM```
ready = true;
ready && sync();
const sync = async () => {
/* some logic * /
jsonCollection.length &&
(await upsertManyA(
jsonCollection.filter((obj) => obj.startsWith(A))
));
jsonCollection.length &&
(await upsertManyB(
jsonCollection.filter((obj) => obj.startsWith(B))
));
jsonCollection.length &&
(await upsertManyC(
jsonCollection.filter((obj) => obj.startsWith(C))
));
/* finish */
};
```
const upsertManyA, upsertManyB, upsertManyC
are async
methods that each make an async
request to an api service then perform an async
prisma upsert
upsertManyA
(first method) runs normally, but upsertManyB
(second method) throws a timeout error everytime when it starts. All async/await methods above are expected to run in serial
node_modules/@prisma/client/runtime/index.js:30855
[0] throw new PrismaClientUnknownRequestError(message, this.client._clientVersion);
[0] ^
[0]
[0] PrismaClientUnknownRequestError:
[0] Invalid `prisma.notAvailable.upsert()` invocation:
[0]
[0]
[0] Error occurred during query execution:
[0] ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })
[0] at RequestHandler.handleRequestError (/node_modules/@prisma/client/runtime/index.js:30855:13)
[0] at RequestHandler.request (/node_modules/@prisma/client/runtime/index.js:30834:12)
[0] at async PrismaClient._request (/node_modules/@prisma/client/runtime/index.js:31812:16)
[0] at async upsertNotAvailable (file:/index.js:313:3) {
[0] clientVersion: '4.4.0'
[0] }
[0]
[0] Node.js v18.11.0
feedback appreciated
thanksNurul
10/19/2022, 11:14 AMupsertManyB
before upsertManyA
does it still timeout at upsertManyB
invocation or there's a change in behaviour? I want to see if the main issue lies in the upsertManyB
invocation.Ridhwaan Shakeel
10/19/2022, 1:44 PMupsertManyB
first, also tried running upsertManyC
first. Both times it is the same error. I put print statements to debug but nothing was printed
Some of the changes i did:
put "type": "module",
in package.json
changed const { PrismaClient } = require('@prisma/client');
-> import { PrismaClient } from '@prisma/client'
Ridhwaan Shakeel
10/19/2022, 3:37 PMVladi Stevanovic