Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete unused variable #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkg/controller/cronmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (n NoNeedUpdate) Error() string {
}

type CronManager struct {
sync.Mutex
//sync.Mutex
cfg *rest.Config
client client.Client
jobQueue *sync.Map
Expand All @@ -47,7 +47,7 @@ type CronManager struct {
}

func (cm *CronManager) createOrUpdate(j CronJob) error {
if _, ok := cm.jobQueue.Load(j.ID()); !ok {
if loadJob, ok := cm.jobQueue.Load(j.ID()); !ok {
err := cm.cronExecutor.AddJob(j)
if err != nil {
return fmt.Errorf("Failed to add job to cronExecutor,because of %v", err)
Expand All @@ -56,7 +56,6 @@ func (cm *CronManager) createOrUpdate(j CronJob) error {
log.Infof("cronHPA job %s of cronHPA %s in %s created, %d active jobs exist", j.Name(), j.CronHPAMeta().Name, j.CronHPAMeta().Namespace,
queueLength(cm.jobQueue))
} else {
loadJob, _ := cm.jobQueue.Load(j.ID())
job, convert := loadJob.(*CronJobHPA)
if !convert {
return fmt.Errorf("failed to convert job %v to CronJobHPA", loadJob)
Expand Down