Skip to content

Commit

Permalink
Merge pull request #6 from cieslarmichal/feature/clear-logs
Browse files Browse the repository at this point in the history
remove http service lib
  • Loading branch information
cieslarmichal authored Feb 9, 2024
2 parents 80606b7 + a6d047b commit 55db7fb
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 183 deletions.
5 changes: 5 additions & 0 deletions apps/backend/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ primary_region = "waw"
cpu_kind = "shared"
cpus = 1
memory_mb = 512

[services.concurrency]
hard_limit = 200
soft_limit = 200
type = "connections"
15 changes: 4 additions & 11 deletions apps/backend/src/core/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export class Application {
await databaseManager.bootstrapDatabase(container);
}

loggerService.info({
loggerService.debug({
message: 'Migrations run success.',
source: Application.name,
});
} catch (error) {
loggerService.info({
loggerService.error({
message: 'Migrations run error.',
source: Application.name,
});
Expand Down Expand Up @@ -69,7 +69,7 @@ export class Application {
const userExists = await sqliteDatabaseClient<UserRawEntity>(userTable.name).where({ email }).first();

if (userExists) {
loggerService.info({
loggerService.debug({
message: 'Admin user already exists.',
email,
source: Application.name,
Expand All @@ -91,7 +91,7 @@ export class Application {
role: UserRole.admin,
});

loggerService.info({
loggerService.debug({
message: 'Admin user created.',
email,
source: Application.name,
Expand Down Expand Up @@ -139,19 +139,12 @@ export class Application {
public static async start(): Promise<void> {
const container = Application.createContainer();

const loggerService = container.get<LoggerService>(coreSymbols.loggerService);

await this.setupDatabase(container);

await this.createAdminUser(container);

const server = new HttpServer(container);

await server.start();

loggerService.log({
message: `Application started.`,
source: Application.name,
});
}
}
12 changes: 0 additions & 12 deletions apps/backend/src/libs/httpService/clients/httpClient/httpClient.ts

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions apps/backend/src/libs/httpService/errors/httpServiceError.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class DeleteResourceCommandHandlerImpl implements DeleteResourceCommandHa
resourceName,
});

this.loggerService.info({
this.loggerService.debug({
message: 'Resource deleted.',
userId,
bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class DownloadImageQueryHandlerImpl implements DownloadImageQueryHandler

const resizedImageData = resource.data.pipe(resizing);

this.loggerService.info({
this.loggerService.debug({
message: 'Image Resource downloaded.',
userId,
bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class DownloadResourceQueryHandlerImpl implements DownloadResourceQueryHa
resourceName,
});

this.loggerService.info({
this.loggerService.debug({
message: 'Resource downloaded.',
userId,
bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class DownloadResourcesQueryHandlerImpl implements DownloadResourcesQuery

archive.finalize();

this.loggerService.info({
this.loggerService.debug({
message: 'Resources downloaded.',
userId,
bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class FindResourcesMetadataQueryHandlerImpl implements FindResourcesMetad
pageSize,
});

this.loggerService.info({
this.loggerService.debug({
message: 'Resources fetched.',
userId,
bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class CrateUserCommandHandlerImpl implements CreateUserCommandHandler {
role: UserRole.user,
});

this.loggerService.info({
this.loggerService.debug({
message: 'User created.',
userId: user.getId(),
email,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DeleteUserCommandHandlerImpl implements DeleteUserCommandHandler {

await this.userRepository.deleteUser({ id: userId });

this.loggerService.info({
this.loggerService.debug({
message: 'User deleted.',
userId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class GrantBucketAccessCommandHandlerImpl implements GrantBucketAccessCom
const existingBuckets = await this.userRepository.findUserBuckets({ userId });

if (existingBuckets.find((userBucket) => userBucket.getBucketName() === bucketName)) {
this.loggerService.info({
this.loggerService.debug({
message: 'Bucket access already granted.',
userId,
bucketName,
Expand All @@ -51,7 +51,7 @@ export class GrantBucketAccessCommandHandlerImpl implements GrantBucketAccessCom
domainActions: existingUser.getDomainActions(),
});

this.loggerService.info({
this.loggerService.debug({
message: 'Bucket access granted.',
userId,
bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class LoginUserCommandHandlerImpl implements LoginUserCommandHandler {
domainActions: user.getDomainActions(),
});

this.loggerService.info({
this.loggerService.debug({
message: 'User logged in.',
email,
userId: user.getId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class RefreshUserTokensCommandHandlerImpl implements RefreshUserTokensCom
expiresIn: accessTokenExpiresIn,
});

this.loggerService.info({
this.loggerService.debug({
message: 'User tokens refreshed.',
userId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class RevokeBucketAccessCommandHandlerImpl implements RevokeBucketAccessC
const existingBuckets = await this.userRepository.findUserBuckets({ userId });

if (!existingBuckets.find((userBucket) => userBucket.getBucketName() === bucketName)) {
this.loggerService.info({
this.loggerService.debug({
message: 'User does not have access to the bucket.',
userId,
bucketName,
Expand All @@ -51,7 +51,7 @@ export class RevokeBucketAccessCommandHandlerImpl implements RevokeBucketAccessC
domainActions: existingUser.getDomainActions(),
});

this.loggerService.info({
this.loggerService.debug({
message: 'Bucket access revoked.',
userId,
bucketName,
Expand Down

0 comments on commit 55db7fb

Please sign in to comment.