Skip to content

Odd behavior with limit #33

@hardysabs2

Description

@hardysabs2
const result = findRemoveSync(process.env.LOG_BASE_DIR, {
  age: { seconds: process.env.SECONDS_TO_RETAIN_LOG_FILES },
  extensions: ".log",
  limit: 100
});

the base dir has multiple directories under it and the log files are under those.
If I have counted right there are around 94 files scattered amongst sub-folders, all *.log, definitely not many more than 100 if at all. All old than the 20s set and it seems to take 2 goes to delete all the files.

I have checked around to see that none of the files are open anywhere. Is there anything else that I may be doing wrong that may be causing this?
What is the behavior if it fails to delete one file, will it still go on to delete the others?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions