From c6d7e5fc23b2f4ec5c4ac1282637eb163dff5b57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:35:45 +0000 Subject: [PATCH 1/4] chore(deps): Bump @prisma/client from 4.15.0 to 5.9.1 Bumps [@prisma/client](https://github.com/prisma/prisma/tree/HEAD/packages/client) from 4.15.0 to 5.9.1. - [Release notes](https://github.com/prisma/prisma/releases) - [Commits](https://github.com/prisma/prisma/commits/5.9.1/packages/client) --- updated-dependencies: - dependency-name: "@prisma/client" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index a1672941..1b2e189d 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "@nestjs/passport": "10.0.2", "@nestjs/platform-express": "8.4.7", "@nestjs/swagger": "5.2.1", - "@prisma/client": "4.15.0", + "@prisma/client": "5.9.1", "@sindresorhus/is": "4.6.0", "assert": "2.0.0", "class-transformer": "0.5.1", diff --git a/yarn.lock b/yarn.lock index a5e20ebb..23bf1e5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -904,15 +904,9 @@ version "1.14.0" resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.14.0.tgz#6a729b7f372ce30f77a3f217c09bc216f863fccb" -"@prisma/client@4.15.0": - version "4.15.0" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.15.0.tgz#f52ec6ca6fbde37395a54b0a9e5da603a9de15f3" - dependencies: - "@prisma/engines-version" "4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944" - -"@prisma/engines-version@4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944": - version "4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944.tgz#8d880becf996cffe08c78ad5afab6bc06090c990" +"@prisma/client@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.9.1.tgz#d92bd2f7f006e0316cb4fda9d73f235965cf2c64" "@prisma/engines@5.3.1": version "5.3.1" From 1ccbf7d66a50cc13e5fc7e19f71ee7772f2bacb1 Mon Sep 17 00:00:00 2001 From: Rohan Jadvani Date: Tue, 30 Apr 2024 17:21:32 -0400 Subject: [PATCH 2/4] Update Prisma --- package.json | 2 +- yarn.lock | 47 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f5dc5435..ab8ac6d1 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "faker": "5.5.3", "jest": "27.5.1", "prettier": "2.8.8", - "prisma": "5.3.1", + "prisma": "5.13.0", "run-script-webpack-plugin": "0.2.0", "supertest": "6.3.3", "ts-jest": "29.1.1", diff --git a/yarn.lock b/yarn.lock index e8c48be8..f365d7f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -908,9 +908,41 @@ version "5.9.1" resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.9.1.tgz#d92bd2f7f006e0316cb4fda9d73f235965cf2c64" -"@prisma/engines@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.3.1.tgz#53cc72a5ed176dc27d22305fe5569c64cc78b381" +"@prisma/debug@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.13.0.tgz#d88b0f6fafa0c216e20e284ed9fc30f1cbe45786" + integrity sha512-699iqlEvzyCj9ETrXhs8o8wQc/eVW+FigSsHpiskSFydhjVuwTJEfj/nIYqTaWFYuxiWQRfm3r01meuW97SZaQ== + +"@prisma/engines-version@5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b": + version "5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b.tgz#a72a4fb83ba1fd01ad45f795aa55168f60d34723" + integrity sha512-AyUuhahTINGn8auyqYdmxsN+qn0mw3eg+uhkp8zwknXYIqoT3bChG4RqNY/nfDkPvzWAPBa9mrDyBeOnWSgO6A== + +"@prisma/engines@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.13.0.tgz#8994ebf7b4e35aee7746a8465ec22738379bcab6" + integrity sha512-hIFLm4H1boj6CBZx55P4xKby9jgDTeDG0Jj3iXtwaaHmlD5JmiDkZhh8+DYWkTGchu+rRF36AVROLnk0oaqhHw== + dependencies: + "@prisma/debug" "5.13.0" + "@prisma/engines-version" "5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b" + "@prisma/fetch-engine" "5.13.0" + "@prisma/get-platform" "5.13.0" + +"@prisma/fetch-engine@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-5.13.0.tgz#9b6945c7b38bb59e840f8905b20ea7a3d059ca55" + integrity sha512-Yh4W+t6YKyqgcSEB3odBXt7QyVSm0OQlBSldQF2SNXtmOgMX8D7PF/fvH6E6qBCpjB/yeJLy/FfwfFijoHI6sA== + dependencies: + "@prisma/debug" "5.13.0" + "@prisma/engines-version" "5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b" + "@prisma/get-platform" "5.13.0" + +"@prisma/get-platform@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-5.13.0.tgz#99ef909a52b9d79b64d72d2d3d8210c4892b6572" + integrity sha512-B/WrQwYTzwr7qCLifQzYOmQhZcFmIFhR81xC45gweInSUn2hTEbfKUPd2keAog+y5WI5xLAFNJ3wkXplvSVkSw== + dependencies: + "@prisma/debug" "5.13.0" "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -4340,11 +4372,12 @@ pretty-format@^27.0.0, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" -prisma@5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.3.1.tgz#a0932c1c1a5ed4ff449d064b193d9c7e94e8bf77" +prisma@5.13.0: + version "5.13.0" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.13.0.tgz#1f06e20ccfb6038ad68869e6eacd3b346f9d0851" + integrity sha512-kGtcJaElNRAdAGsCNykFSZ7dBKpL14Cbs+VaQ8cECxQlRPDjBlMHNFYeYt0SKovAVy2Y65JXQwB3A5+zIQwnTg== dependencies: - "@prisma/engines" "5.3.1" + "@prisma/engines" "5.13.0" process-nextick-args@~2.0.0: version "2.0.1" From 9b8c799c287b350fc675485c17690dc88d6f803a Mon Sep 17 00:00:00 2001 From: Rohan Jadvani Date: Tue, 30 Apr 2024 17:23:58 -0400 Subject: [PATCH 3/4] Update client --- src/prisma/types/base-prisma-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prisma/types/base-prisma-client.ts b/src/prisma/types/base-prisma-client.ts index 1bd187e8..2a5fc2db 100644 --- a/src/prisma/types/base-prisma-client.ts +++ b/src/prisma/types/base-prisma-client.ts @@ -5,5 +5,5 @@ import { PrismaClient } from '.prisma/client'; export type BasePrismaClient = Omit< PrismaClient, - '$connect' | '$disconnect' | '$on' | '$transaction' | '$use' + '$connect' | '$disconnect' | '$on' | '$transaction' | '$use' | '$extends' >; From 97d38a71d345c52b94e47488959e671564e77db9 Mon Sep 17 00:00:00 2001 From: Rohan Jadvani Date: Tue, 30 Apr 2024 17:35:21 -0400 Subject: [PATCH 4/4] Fix --- package.json | 2 +- .../faucet-transactions.service.ts | 53 +++++++++---------- yarn.lock | 7 +-- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index ab8ac6d1..53660832 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "@nestjs/passport": "10.0.2", "@nestjs/platform-express": "8.4.7", "@nestjs/swagger": "5.2.1", - "@prisma/client": "5.9.1", + "@prisma/client": "5.13.0", "@sindresorhus/is": "4.6.0", "assert": "2.0.0", "class-transformer": "0.5.1", diff --git a/src/faucet-transactions/faucet-transactions.service.ts b/src/faucet-transactions/faucet-transactions.service.ts index 7d0f19e4..a77717e1 100644 --- a/src/faucet-transactions/faucet-transactions.service.ts +++ b/src/faucet-transactions/faucet-transactions.service.ts @@ -72,41 +72,40 @@ export class FaucetTransactionsService { options: NextFaucetTransactionsOptions, ): Promise { const count = options.count ?? 1; - return this.prisma.$transaction(async (prisma) => { - const currentlyRunningFaucetTransactions = - await prisma.faucetTransaction.findMany({ + const currentlyRunningFaucetTransactions = + await this.prisma.faucetTransaction.findMany({ + where: { + started_at: { + not: null, + }, + completed_at: null, + }, + orderBy: { + created_at: Prisma.SortOrder.asc, + }, + take: count, + }); + + if (currentlyRunningFaucetTransactions.length < count) { + const diff = count - currentlyRunningFaucetTransactions.length; + const unfulfilledFaucetTransactions = + await this.prisma.faucetTransaction.findMany({ where: { - started_at: { - not: null, - }, + started_at: null, completed_at: null, }, orderBy: { created_at: Prisma.SortOrder.asc, }, - take: count, + take: diff, }); - if (currentlyRunningFaucetTransactions.length < count) { - const diff = count - currentlyRunningFaucetTransactions.length; - const unfulfilledFaucetTransactions = - await prisma.faucetTransaction.findMany({ - where: { - started_at: null, - completed_at: null, - }, - orderBy: { - created_at: Prisma.SortOrder.asc, - }, - take: diff, - }); - return [ - ...currentlyRunningFaucetTransactions, - ...unfulfilledFaucetTransactions, - ]; - } + return [ + ...currentlyRunningFaucetTransactions, + ...unfulfilledFaucetTransactions, + ]; + } - return currentlyRunningFaucetTransactions; - }); + return currentlyRunningFaucetTransactions; } async start( diff --git a/yarn.lock b/yarn.lock index f365d7f5..54125a6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -904,9 +904,10 @@ version "1.14.0" resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.14.0.tgz#6a729b7f372ce30f77a3f217c09bc216f863fccb" -"@prisma/client@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.9.1.tgz#d92bd2f7f006e0316cb4fda9d73f235965cf2c64" +"@prisma/client@5.13.0": + version "5.13.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.13.0.tgz#b9f1d0983d714e982675201d8222a9ecb4bdad4a" + integrity sha512-uYdfpPncbZ/syJyiYBwGZS8Gt1PTNoErNYMuqHDa2r30rNSFtgTA/LXsSk55R7pdRTMi5pHkeP9B14K6nHmwkg== "@prisma/debug@5.13.0": version "5.13.0"