Skip to content

Commit

Permalink
Merge pull request #16 from bcgov/fix/rotateSyncFilePath
Browse files Browse the repository at this point in the history
fix: join path
  • Loading branch information
mbystedt authored Jan 18, 2024
2 parents f74615b + 177bdba commit 0f1cd75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cron/rotate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export async function rotateLogs(db: DatabaseService) {
const files = fs.readdirSync(LOGROTATE_DIRECTORY);
const now = new Date().getTime();
let logFiles = files.filter((file) => file.endsWith(LOGROTATE_SUFFIX));
logFiles = files.filter((file) => {
const stats = fs.statSync(file);
logFiles = logFiles.filter((file) => {
const stats = fs.statSync(path.join(LOGROTATE_DIRECTORY, file));
const endTime = stats.ctime.getTime() + LOGROTATE_AGE_MAX;
const rotateFile =
stats.size > 0 &&
Expand Down

0 comments on commit 0f1cd75

Please sign in to comment.