Merge pull request #528 from dod-ccpo/reload-extra

Cache all calls to translation file and refresh cache when file changes
This commit is contained in:
George Drummond 2019-01-09 11:34:25 -05:00 committed by GitHub
commit c9fa8a4312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

2
app.py
View File

@ -7,5 +7,5 @@ app = make_app(config)
if __name__ == "__main__":
port = int(config["PORT"])
app.run(port=port)
app.run(port=port, extra_files=["translations.yaml"])
print("Listening on http://localhost:%i" % port)

View File

@ -18,10 +18,7 @@ class LocalizationInvalidKeyError(Exception):
)
translations_yaml_max_cache = 0 if ENV == "dev" else None
@lru_cache(maxsize=translations_yaml_max_cache)
@lru_cache(maxsize=None)
def _translations_file():
file_name = "translations.yaml"