Skip to content

Commit

Permalink
chore(go): fixed deepsource issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi committed Mar 19, 2024
1 parent 94d9337 commit 7892e72
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# dlm
Distributed Lock Manager
a fault-tolerant distributed lock manager for Go

![License](https://img.shields.io/badge/license-MIT-green.svg)
[![Tests](https://github.com/yaitoo/dlm/actions/workflows/tests.yml/badge.svg)](https://github.com/yaitoo/dlm/actions/workflows/tests.yml)
[![Go Reference](https://pkg.go.dev/badge/github.com/yaitoo/dlm.svg)](https://pkg.go.dev/github.com/yaitoo/dlm)
[![Codecov](https://codecov.io/gh/yaitoo/dlm/branch/main/graph/badge.svg)](https://codecov.io/gh/yaitoo/dlm)
[![GitHub Release](https://img.shields.io/github/v/release/yaitoo/dlm)](https://github.com/yaitoo/dlm/blob/main/CHANGELOG.md)
[![Go Report Card](https://goreportcard.com/badge/yaitoo/dlm)](http://goreportcard.com/report/yaitoo/dlm)


inspired by
Expand Down
12 changes: 0 additions & 12 deletions cmd.go

This file was deleted.

2 changes: 1 addition & 1 deletion node_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (n *Node) NewLock(req LockRequest, t *Lease) error {
lease, err := n.getLease(req.Topic, req.Key)

if err == nil { // exits a lease
if lease.Lessee != req.ID && lease.IsLive() { //someone else's lease is still live
if lease.Lessee != req.ID && lease.IsLive() { // someone else's lease is still live
return ErrLeaseExists
}
} else {
Expand Down
3 changes: 2 additions & 1 deletion node_svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/rpc"
)

// Serve start the node's RPC service
// Start start the node and its RPC service
func (n *Node) Start(ctx context.Context) error {
l, err := net.Listen("tcp", n.addr)
if err != nil {
Expand All @@ -32,6 +32,7 @@ func (n *Node) Start(ctx context.Context) error {
return n.server.RegisterName("dlm", n)
}

// Stop stop the node and its RPC service
func (n *Node) Stop() {
n.close <- struct{}{}
n.logger.Info("dlm: node stopped")
Expand Down

0 comments on commit 7892e72

Please sign in to comment.