Skip to content

Commit

Permalink
Merge pull request #1258 from MetPX/inflight_fileAgeMin
Browse files Browse the repository at this point in the history
tweaks to flowcb/gather/file.py after experiments with noticing large files.
  • Loading branch information
petersilva authored Oct 11, 2024
2 parents 99141d4 + f9b76dd commit 1c7261d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sarracenia/flowcb/gather/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class File(FlowCB):
also should likely switch from listdir to scandir
"""
def on_add(self, event, src, dst):
logger.debug("on_add %s %s %s" % ( event, src, dst ) )
logger.debug("%s %s %s" % ( event, src, dst ) )
self.new_events['%s %s' % (src, dst)] = (event, src, dst)

def on_created(self, event):
Expand Down Expand Up @@ -465,12 +465,15 @@ def process_event(self, event, src, dst):
age = time.time() - lstat.st_mtime

if age < self.o.fileAgeMin:
logger.debug( "%d vs (inflight setting) %d seconds. Too New!" % (age,self.o.fileAgeMin) )
logger.debug("%d vs (fileAgeMin setting) %d seconds. Too New! %s" % (age,self.o.fileAgeMin,src) )
return (False, [])

if self.o.fileAgeMax > 0 and age > self.o.fileAgeMax:
logger.debug("%d vs (fileAgeMax setting) %d seconds. Too Old!" % (age,self.o.fileAgeMax) )
logger.debug("%d vs (fileAgeMax setting) %d seconds. Too Old! %s" % (age,self.o.fileAgeMax,src) )
return (True, [])
else:
logger.debug(f"lstat or st_mtime problem? lstat={lstat}")
logger.debug(f"st_mtime={lstat.st_mtime}")

# post it

Expand Down

0 comments on commit 1c7261d

Please sign in to comment.