Skip to content

Commit

Permalink
chore: update docs and node version
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbutongit committed Jan 19, 2024
1 parent 89296be commit bd2f2d1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# forms-queue
This ia a monorepo for forms-queue/reference-api and forms-queue/worker.

## @forms-queue/reference-api

Reference-api is a microservice which will store a job_id (uuid) against a reference number by POST request.
This ia a monorepo for forms-queue/worker.

## @forms-queue/worker

Expand All @@ -12,8 +8,8 @@ Worker is a process which listens to a database-backed queue, and sends it to th

## Prerequisites
1. A node version manager, like [nvm](https://formulae.brew.sh/formula/nvm), or [n](https://github.com/tj/n)
2. node 18.x.x
3. yarn >= v1.22. This project uses yarn 3. Yarn v1.22 will load the correct version of yarn by looking at [.yarnrc](./.yarnrc.yml) and [.yarn](./yarn)
2. node 20.x.x
3. yarn >= v1.22. This project uses yarn 4. Yarn v1.22 will load the correct version of yarn by looking at [.yarnrc](./.yarnrc.yml) and [.yarn](./yarn)
4. Docker >= 3.9 - [Install docker engine](https://docs.docker.com/engine/install/)


Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"workspaces": [
"worker"
],
"engines": {
"node": ">=20.11.0"
},
"scripts": {
"worker": "yarn workspace @forms-queue/worker",
"lint": "yarn workspaces foreach run lint",
Expand Down
2 changes: 1 addition & 1 deletion worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Stage 1
# Base image contains the updated OS and
# It also configures the non-root user that will be given permission to copied files/folders in every subsequent stages
FROM node:18-alpine AS base
FROM node:20-alpine AS base
RUN npm install -g npm@latest && \
apk update && \
apk upgrade && \
Expand Down
3 changes: 3 additions & 0 deletions worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"test": "jest --coverage",
"release": "semantic-release"
},
"engines": {
"node": ">=20.11.0"
},
"devDependencies": {
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.5",
Expand Down
8 changes: 4 additions & 4 deletions worker/src/queues/submission/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ The log will look like:
If the logs are incomplete, further logging may be found on the database in the `output` column.

```postgresql
select data, output from job where id = '6aa3b250-4bc8-4fcb-9a15-7ca56551d04b';
select data, output from pgboss.job where id = '6aa3b250-4bc8-4fcb-9a15-7ca56551d04b';
```

`ECONNREFUSED` may be due to misconfigured webhook_url.

Events can easily be retried by setting completedon = null, retrycount = 0, state = 'created'
```postgresql
update job
update pgboss.job
set data = jsonb_set(
data,
'{webhook_url}',
Expand All @@ -43,7 +43,7 @@ Events can easily be retried by setting completedon = null, retrycount = 0, stat

If you wish to keep a record of the failed event, create a new event using the failed events details.
```postgresql
insert into job (name, data)
insert into pgboss.job (name, data)
SELECT name, data
from job where id = '4aad27dc-db53-48e4-824b-612a4b3d9fa7';
from pgboss.job where id = '4aad27dc-db53-48e4-824b-612a4b3d9fa7';
```

0 comments on commit bd2f2d1

Please sign in to comment.