Переведите приём и чтение вложений на асинхронный контракт
This commit is contained in:
@@ -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) })
|
||||
|
||||
Reference in New Issue
Block a user