Skip to content

Commit 4a986a7

Browse files
committed
fix: environment variable issues
1 parent bdd6d4a commit 4a986a7

File tree

3 files changed

+57
-2
lines changed

3 files changed

+57
-2
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ WEBHOOK_PATH=/api/github/webhooks
1414
# Pull configurations
1515
CONFIG_FILENAME=pull.yml
1616
DEFAULT_MERGE_METHOD=hardreset
17+
# MongoDB
18+
MONGODB_URL=mongodb://root:mongodb_password@mongodb:27017
19+
# Redis
20+
REDIS_URL=redis://redis:6379
1721

1822
# Optional #
1923

docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ services:
1212
# volumes:
1313
# - .:/app
1414
command: deno task dev
15+
## Skip full-sync on startup:
16+
# command: deno task dev:skip-full-sync
17+
## Run full-sync manually:
18+
# > docker exec -it <CONTAINER_NAME> deno task full-sync
1519

1620
worker:
1721
build: .
@@ -25,6 +29,11 @@ services:
2529
# volumes:
2630
# - .:/app
2731
command: deno task worker
32+
deploy:
33+
mode: replicated
34+
replicas: 3
35+
# If running without swarm mode, you can use the following command to scale the worker:
36+
# > docker compose up -d --scale worker=3
2837

2938
mongodb:
3039
image: mongo:8
@@ -45,6 +54,38 @@ services:
4554
# ports:
4655
# - "6379:6379"
4756

57+
# mongo-express:
58+
# image: mongo-express
59+
# restart: unless-stopped
60+
# depends_on:
61+
# - mongodb
62+
# environment:
63+
# ME_CONFIG_MONGODB_URL: mongodb://root:mongodb_password@mongodb:27017/
64+
# ME_CONFIG_BASICAUTH: false
65+
# ports:
66+
# - "8081:8081"
67+
68+
# redis-commander:
69+
# image: rediscommander/redis-commander:latest
70+
# restart: unless-stopped
71+
# environment:
72+
# REDIS_HOSTS: redis
73+
# depends_on:
74+
# - redis
75+
# ports:
76+
# - "8082:8081"
77+
78+
# bullboard:
79+
# image: addono/bull-board:latest
80+
# restart: unless-stopped
81+
# environment:
82+
# REDIS_HOST: redis
83+
# PORT: 8083
84+
# depends_on:
85+
# - redis
86+
# ports:
87+
# - "8083:8083"
88+
4889
volumes:
4990
mongodb-data:
5091
redis-data:

src/router/repo-handler.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,19 @@ function getRepoHandlers(
6868
const full_name = `${req.params.owner}/${req.params.repo}`;
6969
app.log.info({ full_name }, `Processing`);
7070

71-
await schedulerService.processRepository({ fullName: full_name }, true);
71+
try {
72+
await schedulerService.processRepository({ fullName: full_name }, true);
7273

73-
res.json({ status: "queued" });
74+
res.json({ status: "queued" });
75+
} catch (error) {
76+
app.log.error(error);
77+
res.status(500).json({
78+
status: "error",
79+
message: error instanceof Error
80+
? error.message
81+
: "Unknown error occurred",
82+
});
83+
}
7484
}
7585

7686
return {

0 commit comments

Comments
 (0)