1 | const myhero = require('myhero');
|
2 | const logger = require('myhero-logger').getLogger('myhero-exception', 'uncaughtException');
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | const app = myhero.createApp();
|
8 | app.set('name', '$');
|
9 |
|
10 | app.configure('all', function () {
|
11 |
|
12 | app.set('pushSchedulerConfig',
|
13 | {
|
14 | scheduler: myhero.pushSchedulers.buffer
|
15 | });
|
16 | });
|
17 |
|
18 |
|
19 | app.configure('all', 'connector', function () {
|
20 |
|
21 | let aes = require('./config/keys').aes;
|
22 |
|
23 |
|
24 | app.set('connectorConfig',
|
25 | {
|
26 | connector: myhero.connectors.hybridconnector,
|
27 | heartbeat: 3,
|
28 | useDict: true,
|
29 | useProtobuf: true,
|
30 | useCrypto: true,
|
31 |
|
32 | aesKey: aes.key,
|
33 | cbciv: aes.iv,
|
34 |
|
35 | checkClient: function (type, version, sha) {
|
36 |
|
37 | logger.info('checkClient type=%, version=%s, sha=%s', type, version, sha);
|
38 | return true;
|
39 | }
|
40 | });
|
41 | });
|
42 |
|
43 |
|
44 | app.start();
|
45 |
|
46 | process.on('uncaughtException', function (err) {
|
47 | logger.error(err.msg + '\n' + err.stack);
|
48 | });
|