File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 2
2
'use strict' ;
3
3
const request = require ( 'org/arangodb/request' ) ;
4
4
5
- const url = applicationContext . configuration . url ;
5
+ const configuredUrl = applicationContext . configuration . url ;
6
+ const configuredInterval = applicationContext . configuration . interval ;
7
+ const currentInterval = applicationContext . argv [ 0 ] . interval ;
6
8
7
- if ( url ) {
8
- request . head ( url , { } ) ;
9
+ if ( currentInterval !== configuredInterval ) {
10
+ require ( 'console' ) . log ( 'heartbeat reconfigured' ) ;
11
+ require ( 'setup' ) ;
12
+ } else if ( configuredUrl ) {
13
+ request . head ( configuredUrl , { } ) ;
9
14
}
Original file line number Diff line number Diff line change 2
2
"name" : " heartbeat" ,
3
3
"description" : " Heartbeat for external monitoring of ArangoDB." ,
4
4
"author" : " Christian Pekeler" ,
5
- "version" : " 1.0.0 " ,
5
+ "version" : " 1.0.1 " ,
6
6
"license" : " Apache License, Version 2.0" ,
7
7
"repository" : {
8
8
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ queue.all().forEach(jobId => queue.delete(jobId));
7
7
const intervalInSeconds = applicationContext . configuration . interval ;
8
8
queue . push (
9
9
{ mount : '/heartbeat' , name : 'beat' } ,
10
- { } ,
10
+ { interval : intervalInSeconds } ,
11
11
{ repeatTimes : - 1 , repeatDelay : intervalInSeconds * 1000 }
12
12
) ;
13
13
You can’t perform that action at this time.
0 commit comments