Skip to content

Commit

Permalink
Fix MediaProxy to make it actually start up (#504)
Browse files Browse the repository at this point in the history
* Fix MediaProxy to make it actually start up
  • Loading branch information
tadzik authored Aug 14, 2024
1 parent a99a449 commit 8be3dbf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/media-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { webcrypto } from 'node:crypto';
import { Request, Response, default as express, Application, NextFunction, Router } from 'express';
import { Request, Response, default as express, NextFunction, Router } from 'express';
import { ApiError, IApiError, Logger, ErrCode } from '..';
import { Server, get } from 'http';
import { MatrixClient } from '@vector-im/matrix-bot-sdk';
Expand Down Expand Up @@ -34,7 +34,6 @@ export class MediaProxy {
/**
* Only used if start() is called.
*/
private readonly app?: Application;
private server?: Server;
/**
* Get the express router used for handling calls.
Expand All @@ -61,10 +60,8 @@ export class MediaProxy {
const app = express();
app.use(this.internalRouter);
return new Promise<void>((res) => {
if (this.app) {
this.server = this.app.listen(port, hostname, backlog, () => res());
log.info(`Media proxy API listening on port ${port}`);
}
this.server = app.listen(port, hostname, backlog, () => res());
log.info(`Media proxy API listening on port ${port}`);
});
}

Expand Down

0 comments on commit 8be3dbf

Please sign in to comment.