New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #17507: inventory watcher should ignore uuid.hive file #3007
Fixes #17507: inventory watcher should ignore uuid.hive file #3007
Conversation
) | ||
val filter = (f:File) => { | ||
val ext = f.extension(includeDot = false, includeAll = false).getOrElse("") | ||
( ext == "gz" || ext == "xml" || ext == "ocs" || ext == "sign") && (f.isRegularFile && ageLimit.isAfter(f.lastModifiedTime.toEpochMilli)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should have a set of authorized extensions, and just have to check if it contains it; I even believe we already have it somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, line 102: could you make it a value in the class ?
val authorizedExtensions = Set("gz", "xml", "ocs", "sign")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure where to defined it exactly, perhaps in object Watchers
PR updated with a new commit |
@@ -79,10 +79,15 @@ final class Watchers(incoming: FileMonitor, updates: FileMonitor) { | |||
} | |||
object Watchers { | |||
|
|||
val inventoryExtentions = "gz" :: "xml" :: "ocs" :: "sign" :: Nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be a set, it's done for that - but actually, for 4 elements, it's still special cased so it shouldn't matter at all.
This PR is not mergeable to upper versions. |
OK, squash merging this PR |
6abe988
to
c3b5961
Compare
https://issues.rudder.io/issues/17507