ЛР 6 — БПИ2302 — Нурлыгаянова — на 3

This commit is contained in:
Nurlygayanova Ekaterina
2026-11-13 11:32:45 +03:00
parent 470d9d6f1e
commit 69a190be0e
164 changed files with 25947 additions and 29 deletions
+40
View File
@@ -0,0 +1,40 @@
package config
// Верхние границы из контракта: конфигурация может их уменьшить, но не превысить.
const (
ContractMaxUploadBytes = 10 * 1024 * 1024
ContractMaxImagePixels = 40_000_000
)
type S3 struct {
Endpoint string
Region string
Bucket string
AccessKeyIDFile string
SecretAccessKeyFile string
// TimeoutMs — предел на одну операцию с S3. Меньше timeout server балансировщика (15 с):
// клиент получает 503 от API, а не 504 от LB.
TimeoutMs int
}
type Attachments struct {
MaxUploadBytes int64
MaxImagePixels int64
// MaxConcurrentUploads ограничивает загрузки на одну реплику и тем самым диск под временные
// файлы (не больше MaxConcurrentUploads × MaxUploadBytes); сверх него — 429.
MaxConcurrentUploads int
}
// MinJanitorGraceSeconds covers the direct ticket lifetime (120s), complete
// timeout (60s), and an additional safety margin before orphan deletion.
const MinJanitorGraceSeconds = 300
// Janitor — очиститель объектов без метаданных (cmd/janitor).
type Janitor struct {
GraceSeconds int
IntervalSeconds int
// MaxDeletes — сколько объектов без строки допустимо удалить за проход. Больше — признак аварии
// (например, БД восстановлена из старой копии), и очиститель ничего не удаляет.
MaxDeletes int
DryRun bool
}