Merged
Conversation
HadronCollider
requested changes
Nov 10, 2025
Dockerfile
Outdated
| RUN STATIC_HASH=$(find app/static -type f -exec md5sum {} \; | md5sum | cut -d' ' -f1) && \ | ||
| echo $STATIC_HASH >> /APP_STATIC_HASH | ||
|
|
||
| ENV APP_STATIC_HASH_FILE=/APP_STATIC_HASH No newline at end of file |
Collaborator
There was a problem hiding this comment.
Кажется, особого смысла держать файл с хэшем нет (т.к. это строка небольшой длины) - хэш можно записать в ENV переменную (возможно, даже не на сборке, а на запуске приложения?), и получить его в приложении
app/config.py
Outdated
| config_raw.read(config_path) | ||
| Config.c = DictToObject(config_raw._sections) | ||
|
|
||
| class VersionCache: |
Collaborator
There was a problem hiding this comment.
Думаю, данная логика и класс всё-таки лишние - достаточно добавить версию в app.config (конфигурация Flask- приложения) и брать её оттуда
app/web_speech_trainer.py
Outdated
| from app.api.trainings import api_trainings | ||
| from app.api.version import api_version | ||
| from app.config import Config | ||
| from app.config import Config, VersionCache |
Collaborator
There was a problem hiding this comment.
VersionCache здесь нигде не используется
app/utils.py
Outdated
|
|
||
| def versioned_url(filename): | ||
| v = VersionCache().get_version() | ||
| return url_for('static', filename=filename) + f'?v={v}' |
Collaborator
There was a problem hiding this comment.
Сейчас url с версией выглядит как ?v=[%27d41d8cd98f00b204e9800998ecf8427e%27] - результат self.version=f.read().split() - вероятно, вы хотели там strip (убрать пробелы)
HadronCollider
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Реализован подсчет хэша всех static-файлов на запуске в Dockerfile, сохранение значения в классе VersionCache, а также функция versioned_url, заменяющая url_for('static',...) и приписывающая к запросу ?v=$hash