Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
cd374122
Commit
cd374122
authored
Jun 28, 2017
by
Kamron Aroonrua
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix amqp startup bug
parent
3904d341
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
4 deletions
+32
-4
scheduler.js
coreservice/scheduler.js
+7
-0
main.js
http-listener/main.js
+6
-0
worker.js
jobworker/worker.js
+15
-2
pm2-default.json
pm2-default.json
+4
-2
No files found.
coreservice/scheduler.js
View file @
cd374122
...
...
@@ -89,6 +89,13 @@ SchedulerService.prototype._start_controller = function ()
var
self
=
this
;
var
topic
=
'ctl.trigger.#'
;
self
.
evs
.
sub
(
topic
,
function
(
err
,
msg
){
if
(
err
){
console
.
log
(
'SCHEDULER:AMQP ERROR Restarting ...'
);
setTimeout
(
function
(){
process
.
exit
(
1
);
},
5000
);
}
if
(
!
msg
){
return
;}
var
ctl
=
msg
.
data
;
...
...
http-listener/main.js
View file @
cd374122
...
...
@@ -74,6 +74,12 @@ HTTPListener.prototype._controller_start = function ()
var
self
=
this
;
var
topic
=
'ctl.trigger.#'
;
self
.
evs
.
sub
(
topic
,
function
(
err
,
msg
){
if
(
err
){
console
.
log
(
'WWW:AMQP ERROR Restarting ...'
);
setTimeout
(
function
(){
process
.
exit
(
1
);
},
5000
);
}
if
(
!
msg
){
return
;}
var
ctl
=
msg
.
data
;
...
...
jobworker/worker.js
View file @
cd374122
...
...
@@ -60,7 +60,14 @@ JW.prototype.amqp_pmr_start = function ()
});
self
.
amqp_server_pmr
.
start
(
function
(
err
){
if
(
err
){
console
.
log
(
'WORKER:AMQP ERROR Restarting ...'
);
setTimeout
(
function
(){
process
.
exit
(
1
);
},
5000
);
}
else
{
console
.
log
(
'WORKER:Primary Start
\
t
\
t[OK]'
);
}
})
}
...
...
@@ -80,7 +87,13 @@ JW.prototype.amqp_snd_start = function ()
});
self
.
amqp_server_snd
.
start
(
function
(
err
){
console
.
log
(
'WORKER:Secondary Start
\
t
\
t[OK]'
);
if
(
err
){
console
.
log
(
'WORKER:AMQP ERROR Restarting ...'
);
setTimeout
(
function
(){
process
.
exit
(
1
);
},
5000
);
}
else
{
console
.
log
(
'WORKER:Secondary Start
\
t
\
t[OK]'
);}
})
}
...
...
pm2-default.json
View file @
cd374122
...
...
@@ -11,8 +11,10 @@
"exec_mode"
:
"cluster"
},
{
"name"
:
"bs.worker.ins0"
,
"script"
:
"./work-jobworker.js"
"name"
:
"bs.worker"
,
"script"
:
"./work-jobworker.js"
,
"exec_mode"
:
"cluster"
,
"instances"
:
0
},
{
"name"
:
"bs.trigger.scheduler"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment