Merge pull request #6241 from steven-zou/logger_framework_job_service

Uncomment the harbor configuration injection code block
This commit is contained in:
Wenkai Yin 2018-11-09 10:41:52 +08:00 committed by GitHub
commit 32c42be677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -340,6 +340,7 @@ So far, only the following two backends are supported:
### Configure loggers
Logger configuration options:
| Option | Description |
|--------------|---------------------------|
| loggers[x].name | The unique name of the logger backend |

View File

@ -16,10 +16,14 @@ package main
import (
"context"
"errors"
"flag"
"fmt"
"github.com/goharbor/harbor/src/adminserver/client"
"github.com/goharbor/harbor/src/jobservice/config"
"github.com/goharbor/harbor/src/jobservice/env"
"github.com/goharbor/harbor/src/jobservice/job/impl"
"github.com/goharbor/harbor/src/jobservice/logger"
"github.com/goharbor/harbor/src/jobservice/runtime"
"github.com/goharbor/harbor/src/jobservice/utils"
@ -51,7 +55,7 @@ func main() {
}
// Set job context initializer
/*runtime.JobService.SetJobContextInitializer(func(ctx *env.Context) (env.JobContext, error) {
runtime.JobService.SetJobContextInitializer(func(ctx *env.Context) (env.JobContext, error) {
secret := config.GetAuthSecret()
if utils.IsEmptyStr(secret) {
return nil, errors.New("empty auth secret")
@ -65,7 +69,7 @@ func main() {
}
return jobCtx, nil
})*/
})
// Start
runtime.JobService.LoadAndRun(ctx, cancel)