mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-12 16:55:39 +00:00
chore: misc bug fixes supporting sqlite migration (#517)
This commit is contained in:
@@ -2,7 +2,6 @@ package orchestrator
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -14,6 +13,7 @@ import (
|
||||
"github.com/garethgeorge/backrest/internal/orchestrator/logging"
|
||||
"github.com/garethgeorge/backrest/internal/orchestrator/repo"
|
||||
"github.com/garethgeorge/backrest/internal/orchestrator/tasks"
|
||||
"github.com/google/uuid"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -160,11 +160,7 @@ func (t *taskRunnerImpl) Logger(ctx context.Context) *zap.Logger {
|
||||
}
|
||||
|
||||
func (t *taskRunnerImpl) LogrefWriter() (string, io.WriteCloser, error) {
|
||||
randBytes := make([]byte, 8)
|
||||
if _, err := rand.Read(randBytes); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
id := fmt.Sprintf("op%d-logref-%x", t.op.Id, randBytes)
|
||||
writer, err := t.orchestrator.logStore.Create(id, t.op.GetId(), time.Duration(0))
|
||||
return id, writer, err
|
||||
logID := uuid.New().String()
|
||||
writer, err := t.orchestrator.logStore.Create(logID, t.op.GetId(), time.Duration(0))
|
||||
return logID, writer, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user