style(app): reformat import statements and improve logging structure
- Simplified and condensed import declarations in `app.module.ts`. - Enhanced error logging format in `crawler-detection.middleware.ts` for better readability.
This commit is contained in:
@@ -1,10 +1,5 @@
|
|||||||
import { CacheModule } from "@nestjs/cache-manager";
|
import { CacheModule } from "@nestjs/cache-manager";
|
||||||
import {
|
import { Logger, MiddlewareConsumer, Module, NestModule } from "@nestjs/common";
|
||||||
Logger,
|
|
||||||
MiddlewareConsumer,
|
|
||||||
Module,
|
|
||||||
NestModule,
|
|
||||||
} from "@nestjs/common";
|
|
||||||
import { ConfigModule, ConfigService } from "@nestjs/config";
|
import { ConfigModule, ConfigService } from "@nestjs/config";
|
||||||
import { ScheduleModule } from "@nestjs/schedule";
|
import { ScheduleModule } from "@nestjs/schedule";
|
||||||
import { ThrottlerModule } from "@nestjs/throttler";
|
import { ThrottlerModule } from "@nestjs/throttler";
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ export class CrawlerDetectionMiddleware implements NestMiddleware {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(`Error checking ban status for IP ${ip}: ${error.message}`);
|
this.logger.error(
|
||||||
|
`Error checking ban status for IP ${ip}: ${error.message}`,
|
||||||
|
);
|
||||||
// On continue même en cas d'erreur Redis pour ne pas bloquer les utilisateurs légitimes
|
// On continue même en cas d'erreur Redis pour ne pas bloquer les utilisateurs légitimes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user