From 94b820c0363d07d8b12740168cdd129b5fe4c437 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 16 Jul 2009 02:52:38 +0000 Subject: FileCaching: only process file updates on exists and changed events (should cut down on unneeded and expensive startup ops) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5335 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 829ab64fd..ff6eb9f22 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -192,8 +192,10 @@ class FileBacked(object): self.data = '' self.name = name - def HandleEvent(self, _=None): + def HandleEvent(self, event=None): '''Read file upon update''' + if event and event.code2str() not in ['exists', 'changed']: + return try: self.data = file(self.name).read() self.Index() -- cgit v1.2.3-1-g7c22