-
Notifications
You must be signed in to change notification settings - Fork 7
/
pm2.config.js
44 lines (41 loc) · 1.17 KB
/
pm2.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const path = __dirname;
const logsPath = path + "/storage/logs/";
const projectName = 'forus';
const ignore_watch = [
".git",
".idea",
".htaccess",
"storage/app",
"storage/framework",
"storage/clockwork",
"storage/debugbar",
"storage/logs",
"public/storage",
"public/assets",
"public/.htaccess",
"node_modules"
];
const makeProcess = (name, args, options = {}) => {
return ({
name,
args,
namespace: `${projectName}`,
script: "./artisan",
interpreter: "php",
watch: true,
cwd: path,
ignore_watch,
watch_delay: 1000,
out_file: logsPath + "laravel-worker.log",
error_file: logsPath + "laravel-worker-err.log",
autorestart: true,
...options
});
}
module.exports = {
apps: [
makeProcess(`${projectName}-emails`, "queue:listen --queue=emails --sleep=3 --tries=3 --timeout=1200"),
makeProcess(`${projectName}-notifications`, "queue:listen --queue=push_notifications --sleep=3 --tries=3 --timeout=1200"),
makeProcess(`${projectName}-media`, "queue:listen --queue=media --sleep=3 --tries=3 --timeout=1200"),
]
};