From 32c17fd8f24bfe14dd05d1423485633fee4946ea Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 23 Jul 2009 20:01:32 +0000 Subject: [PATCH] ReadPreps can also use the netcopy complete flags which causes problems so I needed to force the "completion file" to be only checked in the root of the runfolder. --- htsworkflow/automation/spoolwatcher.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htsworkflow/automation/spoolwatcher.py b/htsworkflow/automation/spoolwatcher.py index 607b2dd..ae794a1 100644 --- a/htsworkflow/automation/spoolwatcher.py +++ b/htsworkflow/automation/spoolwatcher.py @@ -91,6 +91,7 @@ class Handler(pyinotify.ProcessEvent): # compute name of the top level directory that had an event # in the current watch path target = get_top_dir(watch_path, event.path) + runfolder = os.path.join(watch_path, target) if not is_runfolder(target): logging.debug("Skipping %s, not a runfolder" % (target,)) @@ -109,7 +110,12 @@ class Handler(pyinotify.ProcessEvent): msg = "Create: %s %s %s %s" % (watch_path, target, event.path, event.name) - if self.completion_file == event.name.lower() or run_already_complete: + # the ReadPrep step uses some of the same file completion flags as the + # main analysis, which means this completion code might get tripped because of it + # so we need to make sure we're getting the completion file in the root of the + # runfolder + if (self.completion_file == event.name.lower() and event.path == runfolder) \ + or run_already_complete: self.last_event[watch_path][target].complete = True msg += "(completed)" -- 2.30.2