use background ctx to cleanup after failed import (#798)

This commit is contained in:
Marko Gacesa 2023-11-14 15:30:43 +00:00 committed by Harness
parent 5f2c81b2af
commit 70fbaaed16

View File

@ -292,7 +292,7 @@ func (r *Repository) Handle(ctx context.Context, data string, _ job.ProgressRepo
if err != nil {
log.Error().Err(err).Msg("failed repository import - cleanup git repository")
if errDel := r.deleteGitRepository(ctx, &systemPrincipal, repo); errDel != nil {
if errDel := r.deleteGitRepository(context.Background(), &systemPrincipal, repo); errDel != nil {
log.Warn().Err(errDel).
Msg("failed to delete git repository after failed import")
}