Fix unit tests.
This commit is contained in:
@@ -74,7 +74,7 @@ func (c *GenerationsCommand) Run(ctx context.Context, args []string) (err error)
|
||||
for _, r := range db.Replicas {
|
||||
generations, err := r.Generations(ctx)
|
||||
if err != nil {
|
||||
log.Printf("%s: cannot list generations", r.Name(), err)
|
||||
log.Printf("%s: cannot list generations: %s", r.Name(), err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
4
db.go
4
db.go
@@ -512,7 +512,7 @@ func (db *DB) Sync() (err error) {
|
||||
changed = true
|
||||
|
||||
if err := db.checkpoint(info, forceCheckpoint); err != nil {
|
||||
return fmt.Errorf("checkpoint: force=%v err=%w", err)
|
||||
return fmt.Errorf("checkpoint: force=%v err=%w", forceCheckpoint, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1054,7 +1054,7 @@ func (db *DB) Restore(ctx context.Context, opt RestoreOptions) error {
|
||||
tmpPath := outputPath + ".tmp"
|
||||
|
||||
// Copy snapshot to output path.
|
||||
logger.Printf("restoring snapshot from %s://%s/%s to %s", r.Name(), generation, minWALIndex, tmpPath)
|
||||
logger.Printf("restoring snapshot from %s://%s/%016x to %s", r.Name(), generation, minWALIndex, tmpPath)
|
||||
if !opt.DryRun {
|
||||
if err := db.restoreSnapshot(ctx, r, pos.Generation, pos.Index, tmpPath); err != nil {
|
||||
return fmt.Errorf("cannot restore snapshot: %w", err)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -238,7 +238,7 @@ func (r *FileReplica) Stop() {
|
||||
func (r *FileReplica) monitor(ctx context.Context) {
|
||||
// Clear old temporary files that my have been left from a crash.
|
||||
if err := removeTmpFiles(r.dst); err != nil {
|
||||
log.Printf("%s(%s): cannot remove tmp files: %w", r.db.Path(), r.Name(), err)
|
||||
log.Printf("%s(%s): cannot remove tmp files: %s", r.db.Path(), r.Name(), err)
|
||||
}
|
||||
|
||||
// Continuously check for new data to replicate.
|
||||
@@ -261,7 +261,7 @@ func (r *FileReplica) monitor(ctx context.Context) {
|
||||
// Determine position, if necessary.
|
||||
if pos.IsZero() {
|
||||
if pos, err = r.pos(); err != nil {
|
||||
log.Printf("%s(%s): cannot determine position: %w", r.db.Path(), r.Name(), err)
|
||||
log.Printf("%s(%s): cannot determine position: %s", r.db.Path(), r.Name(), err)
|
||||
continue
|
||||
} else if pos.IsZero() {
|
||||
log.Printf("%s(%s): no generation, waiting for data", r.db.Path(), r.Name())
|
||||
|
||||
Reference in New Issue
Block a user