diff --git a/coretex/_task/worker/artifacts.py b/coretex/_task/worker/artifacts.py index 3c61bcf3..aff384b4 100644 --- a/coretex/_task/worker/artifacts.py +++ b/coretex/_task/worker/artifacts.py @@ -50,9 +50,16 @@ def on_created(self, event: FileSystemEvent) -> None: if filePath.name in IGNORED_FILES: return - logging.getLogger("coretex").debug(f">> [Coretex] File created at path \"{filePath}\", adding to artifacts list") + logging.getLogger("coretexpylib").debug(f">> [Coretex] File created at path \"{filePath}\", adding to artifacts list") self.artifactPaths.append(filePath) + def on_deleted(self, event: FileSystemEvent) -> None: + filePath = Path(event.src_path) + + if filePath in self.artifactPaths: + logging.getLogger("coretexpylib").debug(f">> [Coretex] Deleted file at path \"{filePath}\", removing from artifacts list") + self.artifactPaths.remove(filePath) + @contextmanager def track(taskRun: TaskRun) -> Iterator[FileEventHandler]: