Переведите приём и чтение вложений на асинхронный контракт

This commit is contained in:
2026-11-18 15:33:32 +03:00
parent efc56b1382
commit bf970227d6
19 changed files with 667 additions and 367 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ type S3 struct {
func StartS3(ctx context.Context) (*S3, error) {
useDockerDesktopPipe()
s := &S3{Region: "us-east-1", Bucket: "messenger-attachments", volume: "lab4-s3-test-" + uuid.NewString()}
s := &S3{Region: "us-east-1", Bucket: "messenger-attachments", volume: "lab5-s3-test-" + uuid.NewString()}
keys := []*string{&s.AccessKey, &s.SecretKey, &s.APIAccessKey, &s.APISecretKey, &s.AdminAccessKey, &s.AdminSecretKey}
for _, key := range keys {
b := make([]byte, 24)
@@ -199,7 +199,7 @@ func (s *S3) Close() {
if s.container != nil {
_ = testcontainers.TerminateContainer(s.container)
}
if strings.HasPrefix(s.volume, "lab4-s3-test-") {
if strings.HasPrefix(s.volume, "lab5-s3-test-") {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
_ = withDocker(ctx, func(cli *testcontainers.DockerClient) error { return cli.VolumeRemove(ctx, s.volume, true) })