Skip to content

Commit

Permalink
Remove GlobalLog as it no longer required
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Aug 30, 2022
1 parent 47e6f68 commit 7aef280
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions dbs/dbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ import (

"github.com/dmwm/dbs2go/utils"
validator "github.com/go-playground/validator/v10"
"github.com/vkuznet/auth-proxy-server/logging"
)

// GlobalLog represents global rorate log object
var GlobalLog *logging.RotateLogWriter

// API structure represents DBS API. Each API has reader (to read
// HTTP POST payload), HTTP writer to write results back to client,
// HTTP context, input HTTP GET paramers, separator for writer,
Expand Down
5 changes: 0 additions & 5 deletions dbs/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,6 @@ func (a *API) SubmitMigration() error {
// the code is based on the following example:
// https://medium.com/geekculture/timeout-context-in-go-e88af0abd08d
func StartMigrationRequest(rec MigrationRequest) {
// set GlobalLog if it is set
if GlobalLog != nil {
log.SetOutput(GlobalLog)
}
// setup context with timeout
ctx, cancel := context.WithTimeout(
context.Background(),
Expand Down Expand Up @@ -1379,7 +1375,6 @@ func updateMigrationStatus(mrec MigrationRequest, status int) error {
args = append(args, mid)
utils.PrintSQL(stm, args, "execute update migration status query")
}
log.Printf("update migration request %d to status %d", mid, status)

_, err = tx.Exec(stm, status, retryCount, hostname, mid)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ func Server(configFile string) {
if err == nil {
rotlogs := logging.RotateLogWriter{RotateLogs: rl}
log.SetOutput(rotlogs)
dbs.GlobalLog = &rotlogs
} else {
log.Println("ERROR: unable to get rotatelogs", err)
}
Expand Down

0 comments on commit 7aef280

Please sign in to comment.