diff --git a/t-rec.gif b/t-rec.gif new file mode 100644 index 0000000..9740639 Binary files /dev/null and b/t-rec.gif differ diff --git a/t-rec.mp4 b/t-rec.mp4 new file mode 100644 index 0000000..c9c51b0 Binary files /dev/null and b/t-rec.mp4 differ diff --git a/t-rec_1.gif b/t-rec_1.gif new file mode 100644 index 0000000..fb1ad21 Binary files /dev/null and b/t-rec_1.gif differ diff --git a/t-rec_1.mp4 b/t-rec_1.mp4 new file mode 100644 index 0000000..7cd00d5 Binary files /dev/null and b/t-rec_1.mp4 differ diff --git a/t-rec_2.gif b/t-rec_2.gif new file mode 100644 index 0000000..fa5fb80 Binary files /dev/null and b/t-rec_2.gif differ diff --git a/t-rec_2.mp4 b/t-rec_2.mp4 new file mode 100644 index 0000000..a95de31 Binary files /dev/null and b/t-rec_2.mp4 differ diff --git a/ui/s3hub/command.go b/ui/s3hub/command.go index c957d6d..d83e820 100644 --- a/ui/s3hub/command.go +++ b/ui/s3hub/command.go @@ -2,7 +2,8 @@ package s3hub import ( "context" - "math/rand" + "crypto/rand" + "math/big" "time" tea "github.com/charmbracelet/bubbletea" @@ -36,8 +37,14 @@ type deleteS3BucketMsg struct { // deleteS3BucketCmd deletes the S3 bucket. func deleteS3BucketCmd(ctx context.Context, app *di.S3App, bucket model.Bucket) tea.Cmd { - d := time.Millisecond * time.Duration(rand.Intn(500)) //nolint:gosec - return tea.Tick(d, func(t time.Time) tea.Msg { + d, err := rand.Int(rand.Reader, big.NewInt(500)) + if err != nil { + // エラーのハンドリング + return tea.Quit + } + delay := time.Millisecond * time.Duration(d.Int64()) + + return tea.Tick(delay, func(t time.Time) tea.Msg { _, err := app.S3BucketDeleter.DeleteS3Bucket(ctx, &usecase.S3BucketDeleterInput{ Bucket: bucket, })