Skip to content

Commit

Permalink
fix(logger): ensure maxFiles validation checks for valid format
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 3, 2025
1 parent ca07b5d commit 3d36c39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export function setupCleanJob(settings: DailyRotateFileTransportOptions) {
if (settings.maxFiles !== undefined) {
const matches = settings.maxFiles.toString().match(/(\d+)([dhm])/)

if (settings.maxFiles) {
if (matches) {
const value = parseInt(matches[1])
const unit = matches[2]
switch (unit) {
Expand Down

0 comments on commit 3d36c39

Please sign in to comment.