Skip to content

Commit

Permalink
Rearchitect exporter to use BullMQ as a background job queueing system (
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso authored Oct 2, 2023
1 parent c1d0cd0 commit eba771d
Show file tree
Hide file tree
Showing 33 changed files with 2,690 additions and 1,094 deletions.
12 changes: 11 additions & 1 deletion compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ services:
NODE_ENV: development
# contains db connection info that matches db service setup below
CONFIG_FILE: config-dev.json
# waits for db to start
# waits for db and redis to start
depends_on:
db_accounts:
condition: service_healthy
db_data:
condition: service_healthy
redis:
condition: service_healthy
# colorizes output
tty: true

Expand Down Expand Up @@ -47,5 +49,13 @@ services:
timeout: 3s
retries: 5

redis:
image: redis:7-alpine
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 1s
timeout: 3s
retries: 5

volumes:
node_modules:
12 changes: 11 additions & 1 deletion compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ services:
NODE_ENV: test
# contains db connection info that matches db service setup below
CONFIG_FILE: config-test.json
# waits for db to start
# waits for db and redis to start
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
# colorizes output
tty: true

Expand All @@ -32,5 +34,13 @@ services:
timeout: 3s
retries: 5

redis:
image: redis:7-alpine
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 1s
timeout: 3s
retries: 5

volumes:
node_modules:
3 changes: 3 additions & 0 deletions config-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"home": "./fake",
"rpc": "https://uni-rpc.reece.sh",
"bech32Prefix": "juno",
"redis": {
"host": "redis"
},
"db": {
"data": {
"dialect": "postgres",
Expand Down
3 changes: 3 additions & 0 deletions config-test.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"redis": {
"host": "redis"
},
"db": {
"data": {
"dialect": "postgres",
Expand Down
4 changes: 4 additions & 0 deletions config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"home": "/Users/noah/.juno/indexer",
"rpc": "https://uni-rpc.reece.sh",
"bech32Prefix": "juno",
"redis": {
"host": "127.0.0.1",
"password": ""
},
"db": {
"data": {
"dialect": "postgres",
Expand Down
10 changes: 6 additions & 4 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
module.exports = {
apps: [
{
name: 'exporter',
script: 'dist/scripts/export/index.js',
name: 'export-tracer',
script: 'dist/scripts/export/trace.js',
wait_ready: true,
listen_timeout: 30000,
kill_timeout: 30000,
},
{
name: 'webhooks',
script: 'dist/scripts/webhooks.js',
name: 'export-processor',
script: 'dist/scripts/export/process.js',
wait_ready: true,
listen_timeout: 30000,
kill_timeout: 30000,
},
{
Expand Down
Loading

0 comments on commit eba771d

Please sign in to comment.