diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-07-16 02:52:38 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-07-16 02:52:38 +0000 |
commit | 94b820c0363d07d8b12740168cdd129b5fe4c437 (patch) | |
tree | 83dfc617dc39f63e32ecc8cabb5ac9ff358711e7 /src | |
parent | e86d1c09a75c9661c9a3b5cc62678c8e8dc7843a (diff) | |
download | bcfg2-94b820c0363d07d8b12740168cdd129b5fe4c437.tar.gz bcfg2-94b820c0363d07d8b12740168cdd129b5fe4c437.tar.bz2 bcfg2-94b820c0363d07d8b12740168cdd129b5fe4c437.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Server/Plugin.py | 4 |
1 files changed, 3 insertions, 1 deletions
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() |