Skip to content

Commit f5e10f6

Browse files
committed
🔧 Add JOB_TIMEOUT environment variable
1 parent d23abc9 commit f5e10f6

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ APP_ID=
33
WEBHOOK_SECRET=development
44
PRIVATE_KEY=
55
PULL_INTERVAL=3600
6+
JOB_TIMEOUT=60
67
MAX_CONCURRENT=10
78
MAX_IN_QUEUE=1000
89
CONFIG_FILENAME=pull.yml

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ENV \
3333
LOG_LEVEL=info \
3434
WEBHOOK_PATH=/webhook \
3535
PULL_INTERVAL=3600 \
36+
JOB_TIMEOUT=60 \
3637
MAX_CONCURRENT=10 \
3738
MAX_IN_QUEUE=1000 \
3839
CONFIG_FILENAME=pull.yml \

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = async (app) => {
3838
const jobId = `${context.payload.repository.full_name}${context.payload.manual ? '-manual' : ''}`
3939
if (!app.limiter.jobStatus(jobId)) {
4040
await app.limiter.schedule({
41-
expiration: 30000,
41+
expiration: (parseInt(process.env.JOB_TIMEOUT, 10) || 60) * 1000,
4242
id: jobId,
4343
priority: context.payload.manual ? 1 : 9
4444
}, () => processRoutineCheck(context, opts))

0 commit comments

Comments
 (0)