Last active
September 13, 2018 10:01
-
-
Save ahmadarif/0ea1b340215c6f8a810bb8c04e504942 to your computer and use it in GitHub Desktop.
Running single Queue & Scheduler on boot of the web sever.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
if (process.env.exec_mode === 'cluster_mode') { | |
if (Number(process.env.NODE_APP_INSTANCE) === 0) { | |
runKue() | |
runScheduler() | |
} | |
} else { | |
runKue() | |
runScheduler() | |
} | |
function runKue() { | |
const Kue = use('Adonis/Addons/Kue') | |
Kue.listen() | |
} | |
function runScheduler() { | |
const Scheduler = use('Adonis/Addons/Scheduler') | |
Scheduler.run() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment