Skip to content

Commit

Permalink
feat(update): minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Jan 22, 2024
1 parent 507daa5 commit 9651246
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 39 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: '3.9'
version: "3.9"

services:
# https://hub.docker.com/r/bitnami/postgresql
# https://github.com/bitnami/bitnami-docker-postgresql
postgresql:
image: docker.io/bitnami/postgresql:14
ports:
- '5432:5432'
- "6432:5432"
environment:
POSTGRESQL_USERNAME: ${POSTGRES_USER:-postgres}
POSTGRESQL_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRESQL_DATABASE: prisma-queue
volumes:
- './data/postgresql:/bitnami/postgresql'
- "./data/postgresql:/bitnami/postgresql"
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"prettycheck": "prettier --check src/ test/",
"prettify": "prettier --write src/ test/",
"typecheck": "tsc --noEmit",
"spec": "DEBUG=prisma-queue,prisma-query vitest --run",
"dev": "DEBUG=prisma-queue,prisma-query vitest --watch",
"spec": "DEBUG=prisma-queue,prisma-query vitest --run --pool=forks",
"dev": "DEBUG=prisma-queue,prisma-query vitest --watch --pool=forks",
"test": "npm run lint && npm run prettycheck && npm run typecheck && npm run spec",
"prepublishOnly": "npm run build"
},
Expand All @@ -61,6 +61,6 @@
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.2.0"
"vitest": "^1.2.1"
}
}
66 changes: 33 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/PrismaQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ export class PrismaQueue<
deleteOn,
alignTimeZone,
};

// Default error handler
this.on("error", (error, job) =>
debug(
job
? `Job with id=${job.id} failed for queue named="${this.name}" with error`
: `Queue named="${this.name}" encountered an unexpected error`,
error,
),
);
}

private get model(): Prisma.QueueJobDelegate {
Expand Down

0 comments on commit 9651246

Please sign in to comment.