Skip to content

Commit

Permalink
fix: store large log outputs in tar bundles of logs
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Feb 3, 2024
1 parent 427792c commit 0cf01e0
Show file tree
Hide file tree
Showing 27 changed files with 572 additions and 413 deletions.
10 changes: 9 additions & 1 deletion backrest.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/garethgeorge/backrest/internal/oplog"
"github.com/garethgeorge/backrest/internal/orchestrator"
"github.com/garethgeorge/backrest/internal/resticinstaller"
"github.com/garethgeorge/backrest/internal/rotatinglog"
"github.com/mattn/go-colorable"
"go.etcd.io/bbolt"
"go.uber.org/zap"
Expand Down Expand Up @@ -63,8 +64,14 @@ func main() {
}
defer oplog.Close()

// Create rotating log storage
logStore := rotatinglog.NewRotatingLog(path.Join(config.DataDir(), "rotatinglogs"), 30)
if err != nil {
zap.S().Fatalf("Error creating rotating log storage: %v", err)
}

// Create orchestrator and start task loop.
orchestrator, err := orchestrator.NewOrchestrator(resticPath, cfg, oplog)
orchestrator, err := orchestrator.NewOrchestrator(resticPath, cfg, oplog, logStore)
if err != nil {
zap.S().Fatalf("Error creating orchestrator: %v", err)
}
Expand All @@ -80,6 +87,7 @@ func main() {
configStore,
orchestrator,
oplog,
logStore,
)

apiAuthenticationHandler := api.NewAuthenticationHandler(authenticator)
Expand Down
60 changes: 30 additions & 30 deletions gen/go/v1/operations.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0cf01e0

Please sign in to comment.