mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-01-23 21:19:31 -06:00
Ping S3 client before running execution
This commit is contained in:
@@ -40,6 +40,19 @@ func (s *Service) RunExecution(ctx context.Context, backupID uuid.UUID) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.ints.S3Client.Ping(
|
||||
back.DecryptedDestinationAccessKey, back.DecryptedDestinationSecretKey,
|
||||
back.DestinationRegion, back.DestinationEndpoint, back.DestinationBucketName,
|
||||
)
|
||||
if err != nil {
|
||||
return updateExec(dbgen.ExecutionsServiceUpdateExecutionParams{
|
||||
ID: ex.ID,
|
||||
Status: sql.NullString{Valid: true, String: "failed"},
|
||||
Message: sql.NullString{Valid: true, String: err.Error()},
|
||||
FinishedAt: sql.NullTime{Valid: true, Time: time.Now()},
|
||||
})
|
||||
}
|
||||
|
||||
pgVersion, err := s.ints.PGDumpClient.ParseVersion(back.DatabasePgVersion)
|
||||
if err != nil {
|
||||
return updateExec(dbgen.ExecutionsServiceUpdateExecutionParams{
|
||||
|
||||
Reference in New Issue
Block a user