# HG changeset patch # User drewp@bigasterisk.com # Date 2016-06-12 02:12:28 # Node ID a7de122a7b18c1cdd1cf3d220173f9bfc43bade3 # Parent bd1d03349b9a8ebabfbb6afe047a015d107ce63d clients were reading this file a LOT. Probably not a performance issue, but distracting in strace output Ignore-this: 180916361bbcc3b0e3a4fe82bda0990a diff --git a/light9/showconfig.py b/light9/showconfig.py --- a/light9/showconfig.py +++ b/light9/showconfig.py @@ -28,9 +28,13 @@ def root(): "LIGHT9_SHOW env variable has not been set to the show root") return r +_showUri = None def showUri(): """Return the show URI associated with $LIGHT9_SHOW.""" - return URIRef(file(path.join(root(), 'URI')).read().strip()) + global _showUri + if _showUri is None: + _showUri = URIRef(file(path.join(root(), 'URI')).read().strip()) + return _showUri def songOnDisk(song): """given a song URI, where's the on-disk file that mpd would read?"""