feat: port verified messenger from lab 6

This commit is contained in:
Dmitrii Grishko
2026-11-14 19:16:28 +03:00
parent 20afc2c790
commit e3d7df4e72
142 changed files with 13702 additions and 0 deletions
@@ -0,0 +1,20 @@
package repositories
import (
"errors"
"os"
"strconv"
"time"
)
func UploadCleanupGrace() (time.Duration, error) {
value := os.Getenv("UPLOAD_CLEANUP_GRACE_SECONDS")
if value == "" {
value = "600"
}
seconds, err := strconv.Atoi(value)
if err != nil || seconds < 120 || seconds > 86400 {
return 0, errors.New("UPLOAD_CLEANUP_GRACE_SECONDS must be between 120 and 86400")
}
return time.Duration(seconds) * time.Second, nil
}