@@ -8,26 +8,16 @@ const server = require("./server");
8
8
const flush = require ( "documentation/tools/flush-cache" ) ;
9
9
const configureLocalBlogs = require ( "./configure-local-blogs" ) ;
10
10
11
- console . log ( clfdate ( ) , `Starting server pid= ${ process . pid } environment= ${ config . environment } ` ) ;
11
+ console . log ( clfdate ( ) , `Starting server` ) ;
12
12
13
- try {
14
- const v8 = require ( 'v8' ) ;
15
- const heapStats = v8 . getHeapStatistics ( ) ;
16
- console . log ( clfdate ( ) , 'Max heap size (MB):' , heapStats . heap_size_limit / ( 1024 * 1024 ) ) ;
17
- } catch ( e ) {
18
- console . log ( clfdate ( ) , 'Error getting heap size:' , e ) ;
19
- }
20
-
21
-
22
- setup ( async err => {
13
+ setup ( async ( err ) => {
23
14
if ( err ) throw err ;
24
15
25
- // Flush the cache of documentation
16
+ // Flush the cache of the public site and documentation
26
17
flush ( ) ;
27
18
28
19
// This is the master process
29
20
if ( config . master ) {
30
-
31
21
// Launch scheduler for background tasks, like backups, emails
32
22
scheduler ( ) ;
33
23
@@ -41,20 +31,17 @@ setup(async err => {
41
31
}
42
32
}
43
33
44
- email . SERVER_START ( null , { container : config . container } ) ;
34
+ // Send an email notification if the server starts or restarts
35
+ email . SERVER_START ( null , { container : config . container } ) ;
36
+
37
+ console . log ( clfdate ( ) , "Finished setting up server" ) ;
45
38
46
39
// Open the server to handle requests
47
40
server . listen ( config . port , function ( ) {
48
- console . log (
49
- clfdate ( ) ,
50
- `Server listening pid=${ process . pid } port=${ config . port } `
51
- ) ;
41
+ console . log ( clfdate ( ) , `Server listening` ) ;
52
42
53
- console . log ( clfdate ( ) , "Finished setting up server" ) ;
54
-
55
43
if ( config . environment === "development" ) {
56
44
configureLocalBlogs ( ) ;
57
- }
58
-
45
+ }
59
46
} ) ;
60
47
} ) ;
0 commit comments