Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image: [backend, clickhouse]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -23,19 +20,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push (${{ matrix.image }})
- name: Build and push
id: build-image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: ${{ matrix.image == 'backend' && 'Dockerfile' || 'clickhouse/Dockerfile' }}
tags: |
ghcr.io/talodev/${{ matrix.image }}:latest
ghcr.io/talodev/${{ matrix.image }}:${{ github.ref_name }}
target: ${{ matrix.image == 'backend' && 'prod' || '' }}
ghcr.io/talodev/backend:latest
ghcr.io/talodev/backend:${{ github.ref_name }}
target: prod

- name: Image digest (${{ matrix.image }})
- name: Image digest
run: echo ${{ steps.build-image.outputs.digest }}

deploy:
Expand Down
11 changes: 3 additions & 8 deletions __mocks__/bullmq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ export class Worker<T> extends EventEmitter {
async process(job: Job<T>): Promise<void> {
try {
await this.processor(job)

await Promise.all(this.listeners('completed').map(async (handler) => {
await handler(job)
}))
await Promise.all(this.listeners('completed').map((handler) => handler(job)))
} catch (err) {
await Promise.all(this.listeners('failed').map(async (handler) => {
await handler(job, err)
}))
await Promise.all(this.listeners('failed').map((handler) => handler(job, err)))
}
}
}
Expand All @@ -59,6 +54,6 @@ export class Queue<T> {

async add(jobName: string, data: T) {
const job = new Job<T>(this.name, jobName, data)
await Promise.all(this.workers.map(async (worker) => await worker.process(job)))
await Promise.all(this.workers.map((worker) => worker.process(job)))
}
}
10 changes: 0 additions & 10 deletions clickhouse/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions clickhouse/entrypoint.sh

This file was deleted.

15 changes: 0 additions & 15 deletions clickhouse/migrations/001CreateEventsTable.sql

This file was deleted.

6 changes: 0 additions & 6 deletions clickhouse/migrations/002CreateEventPropsTable.sql

This file was deleted.

4 changes: 1 addition & 3 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ services:
- test-network

test-clickhouse:
build:
context: .
dockerfile: ./clickhouse/Dockerfile
image: clickhouse/clickhouse-server:24.12-alpine
environment:
CLICKHOUSE_USER: ${CLICKHOUSE_USER}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
Expand Down
5 changes: 1 addition & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ services:
- 6379:6379

clickhouse:
build:
context: .
dockerfile: ./clickhouse/Dockerfile
image: clickhouse
image: clickhouse/clickhouse-server:24.12-alpine
environment:
CLICKHOUSE_USER: ${CLICKHOUSE_USER}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
Expand Down
169 changes: 100 additions & 69 deletions package-lock.json

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

Loading
Loading