Skip to content

Commit

Permalink
refactor: move healthchecker to top level in src
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Makila committed Sep 13, 2020
1 parent 037a241 commit 42030b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ EXPOSE 8000

CMD ["node", "dist/server.js"]

HEALTHCHECK --interval=10s --timeout=10s --start-period=5s --retries=3 CMD ["node", "dist/healthcheck/healthcheck.js"]
HEALTHCHECK --interval=10s --timeout=10s --start-period=5s --retries=3 CMD ["node", "dist/healthcheck.js"]
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('healthcheck', () => {
it('should exit with error code 1 if an error occurs', () => {
const exitSpy = jest.spyOn(process, 'exit').mockImplementation();

require('../index');
require('../healthcheck');

map['error'](new Error());

Expand All @@ -42,7 +42,7 @@ describe('healthcheck', () => {
])('should exit with error code %s if the response has status code %s', (exitCode, statusCode) => {
const exitSpy = jest.spyOn(process, 'exit').mockImplementation();

require('../index');
require('../healthcheck');

const response = {
statusCode
Expand Down
2 changes: 1 addition & 1 deletion src/healthcheck/healthcheck.ts → src/healthcheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import http from 'http';
import path from 'path';
import fs from 'fs';
import FormData from 'form-data';
import { info, trace } from '../logger';
import { info, trace } from './logger';

const form = new FormData();
form.append('data', fs.createReadStream(path.resolve('src/healthcheck/rosterFile.rosz')));
Expand Down

0 comments on commit 42030b8

Please sign in to comment.