forked-synapse/synapse/rest
Kegan Dougal 2771447c29 Store Promise<Response> instead of Response for HTTP API transactions
This fixes a race whereby:
 - User hits an endpoint.
 - No cached transaction so executes main code.
 - User hits same endpoint.
 - No cache transaction so executes main code.
 - Main code finishes executing and caches response and returns.
 - Main code finishes executing and caches response and returns.

 This race is common in the wild when Synapse is struggling under load.
 This commit fixes the race by:
  - User hits an endpoint.
  - Caches the promise to execute the main code and executes main code.
  - User hits same endpoint.
  - Yields on the same promise as the first request.
  - Main code finishes executing and returns, unblocking both requests.
2016-11-10 14:49:26 +00:00
..
client Store Promise<Response> instead of Response for HTTP API transactions 2016-11-10 14:49:26 +00:00
key Improve comment formatting 2016-10-12 14:45:13 +01:00
media Set CORs headers on responses from the media repo 2016-11-02 11:29:25 +00:00
__init__.py Add store-and-forward direct-to-device messaging 2016-08-25 17:35:37 +01:00