Skip to content

Commit 0059846

Browse files
committed
resolved copilot coments
1 parent 67ebf17 commit 0059846

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

azcopy/jobLifecycleManager.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"github.com/Azure/azure-storage-azcopy/v10/jobsAdmin"
3232
)
3333

34-
type JobProgressTracker interface {
34+
type jobProgressTracker interface {
3535
// Start - calls OnStart
3636
Start()
3737
// CheckProgress checks the progress of the job and returns the number of transfers completed so far and whether the job is done
@@ -44,7 +44,7 @@ type JobProgressTracker interface {
4444
GetElapsedTime() time.Duration
4545
}
4646

47-
type JobLifecycleManager struct {
47+
type jobLifecycleManager struct {
4848
completionFuncs []func()
4949
completionChan chan struct{}
5050
errorChan chan string
@@ -62,8 +62,8 @@ type JobLifecycleManager struct {
6262
// - Automatically reduces to 2-minute intervals for large jobs (>1M transfers)
6363
// - Matches the behavior of AzCopy's lifecycle manager
6464
// - Logs frequency changes via the Info() method
65-
func NewJobLifecycleManager(handler *common.JobUIHooks) *JobLifecycleManager {
66-
jlcm := &JobLifecycleManager{
65+
func NewJobLifecycleManager(handler *common.JobUIHooks) *jobLifecycleManager {
66+
jlcm := &jobLifecycleManager{
6767
completionFuncs: make([]func(), 0),
6868
completionChan: make(chan struct{}, 1),
6969
errorChan: make(chan string, 1),
@@ -74,11 +74,11 @@ func NewJobLifecycleManager(handler *common.JobUIHooks) *JobLifecycleManager {
7474
return jlcm
7575
}
7676

77-
func (j *JobLifecycleManager) RegisterCloseFunc(f func()) {
77+
func (j *jobLifecycleManager) RegisterCloseFunc(f func()) {
7878
j.completionFuncs = append(j.completionFuncs, f)
7979
}
8080

81-
func (j *JobLifecycleManager) OnComplete() {
81+
func (j *jobLifecycleManager) OnComplete() {
8282
j.mutex.Lock()
8383
defer j.mutex.Unlock()
8484

@@ -103,7 +103,7 @@ func (j *JobLifecycleManager) OnComplete() {
103103
}
104104

105105
// TODO : rename interface method to OnError to match other method naming conventions
106-
func (j *JobLifecycleManager) Error(err string) {
106+
func (j *jobLifecycleManager) Error(err string) {
107107
j.mutex.Lock()
108108
defer j.mutex.Unlock()
109109

@@ -128,13 +128,13 @@ func (j *JobLifecycleManager) Error(err string) {
128128
}
129129
}
130130

131-
func (j *JobLifecycleManager) GetError() error {
131+
func (j *jobLifecycleManager) GetError() error {
132132
j.mutex.RLock()
133133
defer j.mutex.RUnlock()
134134
return common.Iff(j.lastError == "", nil, errors.New(j.lastError))
135135
}
136136

137-
func (j *JobLifecycleManager) Wait() error {
137+
func (j *jobLifecycleManager) Wait() error {
138138
j.mutex.RLock()
139139
isDone := j.done
140140
lastError := j.lastError
@@ -156,7 +156,7 @@ func (j *JobLifecycleManager) Wait() error {
156156
}
157157
}
158158

159-
func (j *JobLifecycleManager) InitiateProgressReporting(ctx context.Context, reporter JobProgressTracker) {
159+
func (j *jobLifecycleManager) InitiateProgressReporting(ctx context.Context, reporter jobProgressTracker) {
160160
reporter.Start()
161161

162162
// Start progress reporting in a separate goroutine with adaptive frequency
@@ -243,7 +243,7 @@ func (j *JobLifecycleManager) InitiateProgressReporting(ctx context.Context, rep
243243
}()
244244
}
245245

246-
func (j *JobLifecycleManager) cancelJob(jobID common.JobID) error {
246+
func (j *jobLifecycleManager) cancelJob(jobID common.JobID) error {
247247
if jobID.IsEmpty() {
248248
return errors.New("cancel job requires the JobID")
249249
}

azcopy/jobsResume.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,27 @@ import (
3333
"github.com/Azure/azure-storage-azcopy/v10/traverser"
3434
)
3535

36+
// ResumeJobOptions contains the optional parameters for resuming a job.
3637
type ResumeJobOptions struct {
3738
SourceSAS string
3839
DestinationSAS string
3940
Handler ResumeJobHandler
4041
}
4142

43+
// ResumeJobProgress contains the progress information for a resumed job.
4244
type ResumeJobProgress struct {
4345
common.ListJobSummaryResponse
4446
Throughput float64
4547
ElapsedTime time.Duration
4648
}
4749

50+
// ResumeJobHandler defines the interface for handling resume job events.
4851
type ResumeJobHandler interface {
4952
OnStart(ctx JobContext)
5053
OnTransferProgress(progress ResumeJobProgress)
5154
}
5255

56+
// ResumeJobResult contains the result of a resumed job.
5357
type ResumeJobResult struct {
5458
common.ListJobSummaryResponse
5559
ElapsedTime time.Duration
@@ -340,4 +344,4 @@ func (r *resumeProgressTracker) GetElapsedTime() time.Duration {
340344
return time.Since(r.jobStartTime)
341345
}
342346

343-
var _ JobProgressTracker = &resumeProgressTracker{}
347+
var _ jobProgressTracker = &resumeProgressTracker{}

cmd/copyEnumeratorInit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ func (cca *CookedCopyCmdArgs) createDstContainer(containerName string, dstWithSA
503503
options := traverser.CreateClientOptions(
504504
common.LogLevelOverrideLogger{ // override our log level here
505505
ILoggerResetable: common.AzcopyCurrentJobLogger,
506-
MinimumLevelToLog: common.Iff(logLevel == common.ELogLevel.Debug(), common.ELogLevel.Debug(), common.ELogLevel.None()),
506+
MinimumLevelToLog: common.Iff(LogLevel == common.ELogLevel.Debug(), common.ELogLevel.Debug(), common.ELogLevel.None()),
507507
}, nil, reauthTok)
508508

509509
sc, err := common.GetServiceClientForLocation(

0 commit comments

Comments
 (0)