Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/http-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class HttpServer {
private readonly port;
private readonly server;

constructor(private taskLogger: any) {
constructor(private taskLogger?: any) {
try {
this.host = process.env.HOST || '0.0.0.0';
this.port = +(process.env.PORT || 8080);
Expand All @@ -28,6 +28,10 @@ export class HttpServer {
}
}

setTaskLogger(taskLogger: any) {
this.taskLogger = taskLogger;
}

private initSecrets() {
const secretsOptions = {
schema: {
Expand All @@ -44,8 +48,7 @@ export class HttpServer {

this.server.post('/secrets', secretsOptions, async (request, reply) => {
try {
const { body }: { body: any } = request;
const { secret } = body;
const { body: secret }: { body: any } = request;
logger.info(`got request to add new mask: ${secret.key}`);
this.taskLogger.addNewMask(secret);
reply.code(201);
Expand Down
1 change: 1 addition & 0 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Logger {
TaskLogger(this.taskLoggerConfig.task, { ...this.taskLoggerConfig.opts, updateLogsRate: true })
.then((taskLogger) => {
this.taskLogger = taskLogger;
this.httpServer.setTaskLogger(taskLogger);
taskLogger.on('error', (err) => {
logger.error(err.stack);
});
Expand Down
2 changes: 1 addition & 1 deletion service.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 1.12.1
version: 1.12.2
Loading