@@ -5,7 +5,6 @@ const log = require("./logger");
5
5
const sender = require ( "./send" ) ;
6
6
const query = require ( './sql/queries' ) ;
7
7
const migrator = require ( './sql/migration/migrator' ) ;
8
- const amqpc = require ( './util/helpers/AMQPConnHelper' ) ;
9
8
10
9
const opts = {
11
10
schema : {
@@ -20,22 +19,20 @@ const opts = {
20
19
}
21
20
} ;
22
21
23
- let connection = undefined ;
24
-
25
22
//webserver healthcheck
26
23
27
- fastify . get ( '/' , opts , function ( request , reply ) {
28
- reply . type ( 'application/json' ) . code ( 200 ) ;
29
- reply . send ( { Webserver : 'Happy' } ) ;
30
- } ) ;
24
+ fastify . get ( '/' , opts , function ( request , reply ) {
25
+ reply . type ( 'application/json' ) . code ( 200 ) ;
26
+ reply . send ( { Webserver : 'Happy' } ) ;
27
+ } ) ;
31
28
32
29
//receive hooks
33
30
34
31
35
32
fastify . post ( '/' , opts , function ( request , reply ) {
36
33
request . body . forEach ( function ( hook ) {
37
34
log . debug ( prettyjson . render ( hook ) ) ;
38
- sender . sendHooks ( connection , hook . type , hook . message ) ;
35
+ sender . sendHooks ( hook . type , hook . message ) ;
39
36
} ) ;
40
37
reply . type ( 'application/json' ) . code ( 200 ) ;
41
38
reply . send ( { Webserver : 'Happy' } ) ;
@@ -44,12 +41,6 @@ fastify.post('/', opts, function(request, reply){
44
41
45
42
fastify . listen ( config . general . port , config . general . host , function ( err ) {
46
43
if ( err ) throw err ;
47
- amqpc . connection ( function ( err , conn ) {
48
- if ( err ) { log . error ( `AMQP Not happy, please check bunnywabbit ${ err } ` ) ;
49
- throw err ;
50
- }
51
- connection = conn ;
52
- } ) ;
53
44
log . info ( `Poracle started on ${ fastify . server . address ( ) . address } :${ fastify . server . address ( ) . port } ` )
54
45
} ) ;
55
46
@@ -61,4 +52,3 @@ query.countQuery('TABLE_NAME','information_schema.tables','table_schema',config.
61
52
migrator . migration1 ( )
62
53
}
63
54
} ) ;
64
-
0 commit comments