Skip to content

Commit c79b50e

Browse files
committed
Remove unneeded return statement and unused method receivers.
1 parent 4f5ee95 commit c79b50e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

pkg/domain/repository/snapshot.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ func (w *worker) updateSnapID(ctx context.Context, oid, nid uint64) error {
9191
strconv.FormatUint(nid, 10))
9292
}
9393

94-
func (w *worker) upsertHistSnapshot(ctx context.Context, sctx sessionctx.Context, snapID uint64) error {
94+
func upsertHistSnapshot(ctx context.Context, sctx sessionctx.Context, snapID uint64) error {
9595
// TODO: fill DB_VER, WR_VER
9696
snapshotsInsert := sqlescape.MustEscapeSQL("INSERT INTO %n.%n (`BEGIN_TIME`, `SNAP_ID`) VALUES (now(), %%?) ON DUPLICATE KEY UPDATE `BEGIN_TIME` = now()",
9797
WorkloadSchema, histSnapshotsTable)
9898
_, err := runQuery(ctx, sctx, snapshotsInsert, snapID)
9999
return err
100100
}
101101

102-
func (w *worker) updateHistSnapshot(ctx context.Context, sctx sessionctx.Context, snapID uint64, errs []error) error {
102+
func updateHistSnapshot(ctx context.Context, sctx sessionctx.Context, snapID uint64, errs []error) error {
103103
var nerr any
104104
if err := stderrors.Join(errs...); err != nil {
105105
nerr = err.Error()
@@ -167,7 +167,7 @@ func (w *worker) startSnapshot(_ctx context.Context) func() {
167167
// another owner won the etcd CAS loop.
168168
// it is unwanted but acceptable. because two owners should share
169169
// similar datetime, same cluster versions.
170-
if err := w.upsertHistSnapshot(ctx, sess, snapID+1); err != nil {
170+
if err := upsertHistSnapshot(ctx, sess, snapID+1); err != nil {
171171
logutil.BgLogger().Info("repository could not insert into hist_snapshots", zap.NamedError("err", err))
172172
continue
173173
}
@@ -215,7 +215,7 @@ func (w *worker) startSnapshot(_ctx context.Context) func() {
215215
}
216216
wg.Wait()
217217

218-
if err := w.updateHistSnapshot(ctx, sess, snapID, errs); err != nil {
218+
if err := updateHistSnapshot(ctx, sess, snapID, errs); err != nil {
219219
logutil.BgLogger().Info("repository snapshot failed: could not update hist_snapshots", zap.NamedError("err", err))
220220
}
221221
}

pkg/domain/repository/worker.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ func (w *worker) stop() {
354354
w.cancel = nil
355355

356356
w.wg.Wait()
357-
return
358357
}
359358

360359
func (w *worker) setRepositoryDest(_ context.Context, dst string) error {

0 commit comments

Comments
 (0)