Skip to content

Commit c2ace1a

Browse files
author
Shayon Mukherjee
committed
Add timestamp on ownername
Adding a timestamp can be useful when debugging
1 parent 6bd148c commit c2ace1a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

...

14.7 MB
Binary file not shown.

exec/exec.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package exec
22

33
import (
4+
"fmt"
45
"math/rand"
56
"os/exec"
67
"strings"
@@ -49,11 +50,13 @@ func (d *Exec) Run(tableName string, keyName string, command string, sleepStartR
4950
randomizeSleep(sleepStartRandom)
5051
}
5152

53+
owner := fmt.Sprintf("for: %s, at: %s", keyName, time.Now().UTC().String())
5254
dl, err := dynamolock.New(
5355
d,
5456
tableName,
5557
dynamolock.WithLeaseDuration(leaseDuration*time.Second),
5658
dynamolock.WithHeartbeatPeriod(heartBeatDuration*time.Second),
59+
dynamolock.WithOwnerName(owner),
5760
)
5861
if err != nil {
5962
return err

0 commit comments

Comments
 (0)