@@ -68,7 +68,7 @@ func (e RepoRefNotFoundError) Is(err error) bool {
6868}
6969
7070// NewRequest creates an archival request, based on the URI. The
71- // resulting ArchiveRequest is suitable for being passed to ArchiveRepository ()
71+ // resulting ArchiveRequest is suitable for being passed to Await ()
7272// if it's determined that the request still needs to be satisfied.
7373func NewRequest (repoID int64 , repo * git.Repository , uri string ) (* ArchiveRequest , error ) {
7474 r := & ArchiveRequest {
@@ -151,6 +151,12 @@ func (aReq *ArchiveRequest) Await(ctx context.Context) (*repo_model.RepoArchiver
151151 }
152152}
153153
154+ // doArchive satisfies the ArchiveRequest being passed in. Processing
155+ // will occur in a separate goroutine, as this phase may take a while to
156+ // complete. If the archive already exists, doArchive will not do
157+ // anything. In all cases, the caller should be examining the *ArchiveRequest
158+ // being returned for completion, as it may be different than the one they passed
159+ // in.
154160func doArchive (ctx context.Context , r * ArchiveRequest ) (* repo_model.RepoArchiver , error ) {
155161 ctx , _ , finished := process .GetManager ().AddContext (ctx , fmt .Sprintf ("ArchiveRequest[%d]: %s" , r .RepoID , r .GetArchiveName ()))
156162 defer finished ()
@@ -259,25 +265,17 @@ func doArchive(ctx context.Context, r *ArchiveRequest) (*repo_model.RepoArchiver
259265 return archiver , nil
260266}
261267
262- // ArchiveRepository satisfies the ArchiveRequest being passed in. Processing
263- // will occur in a separate goroutine, as this phase may take a while to
264- // complete. If the archive already exists, ArchiveRepository will not do
265- // anything. In all cases, the caller should be examining the *ArchiveRequest
266- // being returned for completion, as it may be different than the one they passed
267- // in.
268- func ArchiveRepository (ctx context.Context , request * ArchiveRequest ) (* repo_model.RepoArchiver , error ) {
269- return doArchive (ctx , request )
270- }
271-
272268var archiverQueue * queue.WorkerPoolQueue [* ArchiveRequest ]
273269
274270// Init initializes archiver
275271func Init (ctx context.Context ) error {
276272 handler := func (items ... * ArchiveRequest ) []* ArchiveRequest {
277273 for _ , archiveReq := range items {
278274 log .Trace ("ArchiverData Process: %#v" , archiveReq )
279- if _ , err := doArchive (ctx , archiveReq ); err != nil {
275+ if archiver , err := doArchive (ctx , archiveReq ); err != nil {
280276 log .Error ("Archive %v failed: %v" , archiveReq , err )
277+ } else {
278+ log .Trace ("ArchiverData Success: %#v" , archiver )
281279 }
282280 }
283281 return nil
0 commit comments