Skip to content

352 DB limitation #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

352 DB limitation #427

wants to merge 2 commits into from

Conversation

t33nsy
Copy link
Collaborator

@t33nsy t33nsy commented May 10, 2025

No description provided.

meta.save()

def check_storage_limit(self, new_file_size):
max_size = int(Config.c.constants.storage_max_size_mbytes)*1024*1024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поскольку вы вынесли логику в DBManager - давайте лимит запишем в его поле (тогда не нужно будет каждый раз преобразовывать данные из конфига)

except:
if(isinstance(file, str)):
size = len(file)
self.check_storage_limit(size)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в случае, если БД переполнена - загрузка (и тренировка) должна быть прервана - иначе сейчас просто пишется сообщение в лог и логика идет дальше

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, в тестовом конфиге это тоже пригодится - как минимум, для selenium-теста, проверяющего страницу capacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Контроль/ограничение занимаемого пространства
2 participants