Skip to content

Commit

Permalink
mysql: make the locking non blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Stig Lindqvist committed Mar 7, 2015
1 parent 9c2cbdc commit 1f1fc41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mysql_mutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ func (m *MysqlMutex) Lock() error {
if node == nil {
continue
}
// int(m.Expiry.Seconds())

sql := fmt.Sprintf("SELECT GET_LOCK('%s', %d);", m.Name, int(m.Expiry.Seconds()))
sql := fmt.Sprintf("SELECT GET_LOCK('%s', %d);", m.Name, 0)
rows, err := node.Query(sql)
if err != nil {
m.logger.Printf("%s\n", err)
Expand Down

0 comments on commit 1f1fc41

Please sign in to comment.