Skip to content

Commit f7d3f78

Browse files
author
vikasrohit
authored
Merge pull request #10 from appirio-tech/dev
Configurable schedule for scheduled worker
2 parents c854e25 + 46ffcfd commit f7d3f78

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

consumer/.ebextensions/01-environment-variables.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ option_settings:
5353
- namespace: aws:elasticbeanstalk:application:environment
5454
option_name: AWS_SECRET_ACCESS_KEY
5555
value: TBD
56+
- namespace: aws:elasticbeanstalk:application:environment
57+
option_name: SCHEDULED_WORKER_SCHEDULE
58+
value: '*/5 * * * *'

consumer/config/custom-environment-variables.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"logFile": "LOG_FILE",
44
"rabbitmqURL": "RABBITMQ_URL",
55
"ownerId": "OWNER_ID",
6+
"scheduledWorkerSchedule": "SCHEDULED_WORKER_SCHEDULE",
67
"aws": {
78
"endpoint": "AWS_ENDPOINT",
89
"region": "AWS_REGION",

consumer/src/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async function start() {
125125
if (!module.parent) {
126126
start();
127127

128-
cron.schedule('*/1 * * * *', function(){
128+
cron.schedule(config.scheduledWorkerSchedule, function(){
129129
scheduleStart();
130130
});
131131
}

0 commit comments

Comments
 (0)