I have a long running script where for each i need...
# orm-help
k
I have a long running script where for each i need to fetch some data from the database. However after a while i get this
GenericFailure
and i'm not really too sure what is happening here..
Copy code
export const GetReachForServiceIds = async (serviceIds: string[], startDate: Date, endDate: Date) => {
    try {
        const result = await PrismaService.reach_growth.findMany({
            where: { service_id: { in: serviceIds }, date: { gte: startDate, lte: endDate } },
        });

        return [result, null] as const;
    } catch (err) {
        Logger.error({ kind: "leaderboard_reach", method: "GetReachForServiceIds", error: err, stack_trace: err.stack });
        return [null, err] as const;
    }
};
Copy code
Invalid `PrismaService.reach_growth.findMany()` invocation in
/home/kay/checkpoint/leaderboards/src/reach/reach.service.ts:19:57

  16 
  17 export const GetReachForServiceIds = async (serviceIds: string[], startDate: Date, endDate: Date) => {
  18     try {
→ 19         const result = await PrismaService.reach_growth.findMany(
  
    at Object.request (/home/kay/checkpoint/leaderboards/node_modules/@prisma/client/runtime/index.js:39818:15)
    at async PrismaClient._request (/home/kay/checkpoint/leaderboards/node_modules/@prisma/client/runtime/index.js:40646:18)
    at async GetReachForServiceIds (/home/kay/checkpoint/leaderboards/src/reach/reach.service.ts:19:24)
    at async LeaderboardReach (/home/kay/checkpoint/leaderboards/src/reach/leaderboard-reach.ts:23:37)
    at async Main (/home/kay/checkpoint/leaderboards/src/reach/main.ts:9:9) {
  code: 'GenericFailure',
  clientVersion: '3.11.0',
  meta: undefined
j