@@ -621,7 +621,7 @@ func (j *juicefs) SetQuota(ctx context.Context, secrets map[string]string, jfsSe
621621 cmdArgs = []string {config .CliPath , "quota" , "set" , secrets ["name" ], "--path" , quotaPath , "--capacity" , strconv .FormatInt (cap , 10 )}
622622 }
623623 log .Info ("quota cmd" , "command" , strings .Join (cmdArgs , " " ))
624- cmdCtx , cmdCancel := context .WithTimeout (ctx , 5 * defaultCheckTimeout )
624+ cmdCtx , cmdCancel := context .WithTimeout (ctx , 10 * defaultCheckTimeout )
625625 defer cmdCancel ()
626626 envs := syscall .Environ ()
627627 for key , val := range jfsSetting .Envs {
@@ -644,25 +644,14 @@ func (j *juicefs) SetQuota(ctx context.Context, secrets map[string]string, jfsSe
644644 return wrapSetQuotaErr (string (res ), err )
645645 }
646646
647- done := make (chan error , 1 )
648- go func () {
649- // ce cli will block until quota is set
650- quotaCmd := j .Exec .CommandContext (context .Background (), config .CeCliPath , args ... )
651- quotaCmd .SetEnv (envs )
652- res , err := quotaCmd .CombinedOutput ()
653- if err == nil {
654- log .Info ("quota set success" , "output" , string (res ))
655- }
656- done <- wrapSetQuotaErr (string (res ), err )
657- close (done )
658- }()
659- select {
660- case <- cmdCtx .Done ():
661- log .Info ("quota set timeout, runs in background" )
662- return nil
663- case err = <- done :
664- return err
647+ quotaCmd := j .Exec .CommandContext (ctx , config .CeCliPath , args ... )
648+ quotaCmd .SetEnv (envs )
649+ res , err := quotaCmd .CombinedOutput ()
650+ if err == nil {
651+ log .Info ("quota set success" , "output" , string (res ))
665652 }
653+
654+ return wrapSetQuotaErr (string (res ), err )
666655}
667656
668657func wrapSetQuotaErr (res string , err error ) error {
0 commit comments