mapproxy/mapproxy — pull request #102 by keithamoss (2013-07-11 03:30:31+00:00)
Title: Avoid concurrent requests to uninitialised services triggering more than one initialisation

When an uninitialised services received multiple concurrent requests it would initialise once for every request. Merely retrieving the timestamp from the app before checking if we need to reload fixed it.

However...this did seem to cause this

```
[Mon May 27 13:21:38 2013] [error] [client 202.1.16.73] mod_wsgi (pid=11004): Exception occurred processing WSGI script 'C:/web_projects/mapproxy/mapproxy-srss/config.py'.
[Mon May 27 13:21:38 2013] [error] [client 202.1.16.73] Traceback (most recent call last):
[Mon May 27 13:21:38 2013] [error] [client 202.1.16.73] File "c:\\pythonenv\\mapproxy-srss\\Lib\\site-packages\\mapproxy-1.5.0a_20130527-py2.7.egg\\mapproxy\\multiapp.py", line 71, in __call__
[Mon May 27 13:21:38 2013] [error] [client 202.1.16.73] return self.handle(req)(environ, start_response)
[Mon May 27 13:21:38 2013] [error] [client 202.1.16.73] TypeError: 'tuple' object is not callable
```

So we worked around it by just catching the exception and repeating the call. It's a bit of a hack =/

Happy to accept suggestions for a better way of handling the "do I really need to reinitialise this service" change :)