mirror of https://github.com/go-gitea/gitea.git
Merge 170177c405
into 852547d0dc
This commit is contained in:
commit
8b4e996fc1
|
@ -245,6 +245,13 @@ func doArchive(ctx context.Context, r *ArchiveRequest) (*repo_model.RepoArchiver
|
||||||
// TODO: add lfs data to zip
|
// TODO: add lfs data to zip
|
||||||
// TODO: add submodule data to zip
|
// TODO: add submodule data to zip
|
||||||
|
|
||||||
|
// Commit and close here to avoid blocking the database for the entirety of the archive generation process
|
||||||
|
err = committer.Commit()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
committer.Close()
|
||||||
|
|
||||||
if _, err := storage.RepoArchives.Save(rPath, rd, -1); err != nil {
|
if _, err := storage.RepoArchives.Save(rPath, rd, -1); err != nil {
|
||||||
return nil, fmt.Errorf("unable to write archive: %w", err)
|
return nil, fmt.Errorf("unable to write archive: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -254,6 +261,14 @@ func doArchive(ctx context.Context, r *ArchiveRequest) (*repo_model.RepoArchiver
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
txCtx, committer, err = db.TxContext(db.DefaultContext)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer committer.Close()
|
||||||
|
ctx, _, finished = process.GetManager().AddContext(txCtx, fmt.Sprintf("ArchiveRequest[%d]: %s", r.RepoID, r.GetArchiveName()))
|
||||||
|
defer finished()
|
||||||
|
|
||||||
if archiver.Status == repo_model.ArchiverGenerating {
|
if archiver.Status == repo_model.ArchiverGenerating {
|
||||||
archiver.Status = repo_model.ArchiverReady
|
archiver.Status = repo_model.ArchiverReady
|
||||||
if err = repo_model.UpdateRepoArchiverStatus(ctx, archiver); err != nil {
|
if err = repo_model.UpdateRepoArchiverStatus(ctx, archiver); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue