Skip to content

Commit 8533bc7

Browse files
committed
Use 2-spaces indentation instead of 4-spaces
1 parent f6bb0c8 commit 8533bc7

File tree

1 file changed

+33
-32
lines changed

1 file changed

+33
-32
lines changed

fastboot.js

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable no-console */
2+
/* eslint-env node */
23

34
'use strict';
45

@@ -10,36 +11,36 @@ const FastBootAppServer = require('fastboot-app-server');
1011
const cluster = require('cluster');
1112

1213
class LoggerWithoutTimestamp {
13-
constructor() {
14-
this.prefix = cluster.isMaster ? 'master' : 'worker';
15-
}
16-
writeLine() {
17-
this._write('info', Array.prototype.slice.apply(arguments));
18-
}
19-
20-
writeError() {
21-
this._write('error', Array.prototype.slice.apply(arguments));
22-
}
23-
24-
_write(level, args) {
25-
args[0] = `[${level}][${this.prefix}] ${args[0]}`;
26-
console.log.apply(console, args);
27-
}
14+
constructor() {
15+
this.prefix = cluster.isMaster ? 'master' : 'worker';
16+
}
17+
writeLine() {
18+
this._write('info', Array.prototype.slice.apply(arguments));
19+
}
20+
21+
writeError() {
22+
this._write('error', Array.prototype.slice.apply(arguments));
23+
}
24+
25+
_write(level, args) {
26+
args[0] = `[${level}][${this.prefix}] ${args[0]}`;
27+
console.log.apply(console, args);
28+
}
2829
}
2930

3031
function writeAppInitializedWhenReady(logger) {
31-
let timeout;
32-
33-
timeout = setInterval(function() {
34-
logger.writeLine('waiting backend');
35-
if (fs.existsSync('/tmp/backend-initialized')) {
36-
logger.writeLine('backend is up. let heroku know the app is ready');
37-
fs.writeFileSync('/tmp/app-initialized', 'hello');
38-
clearInterval(timeout);
39-
} else {
40-
logger.writeLine('backend is still not up');
41-
}
42-
}, 1000);
32+
let timeout;
33+
34+
timeout = setInterval(function() {
35+
logger.writeLine('waiting backend');
36+
if (fs.existsSync('/tmp/backend-initialized')) {
37+
logger.writeLine('backend is up. let heroku know the app is ready');
38+
fs.writeFileSync('/tmp/app-initialized', 'hello');
39+
clearInterval(timeout);
40+
} else {
41+
logger.writeLine('backend is still not up');
42+
}
43+
}, 1000);
4344
}
4445

4546
var logger = new LoggerWithoutTimestamp();
@@ -49,14 +50,14 @@ logger.writeLine(`${os.cpus().length} cores available`);
4950
let workerCount = process.env.WEB_CONCURRENCY || 1;
5051

5152
let server = new FastBootAppServer({
52-
distPath: 'dist',
53-
port: 9000,
54-
ui: logger,
55-
workerCount: workerCount,
53+
distPath: 'dist',
54+
port: 9000,
55+
ui: logger,
56+
workerCount: workerCount,
5657
});
5758

5859
if (!cluster.isWorker) {
59-
writeAppInitializedWhenReady(logger);
60+
writeAppInitializedWhenReady(logger);
6061
}
6162

6263
server.start();

0 commit comments

Comments
 (0)