From 1f1fc416cae5a50d26f3342351714f2ec8154d0e Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Sat, 7 Mar 2015 19:07:11 +1300 Subject: [PATCH] mysql: make the locking non blocking --- mysql_mutex.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql_mutex.go b/mysql_mutex.go index 315e067..bb8885a 100644 --- a/mysql_mutex.go +++ b/mysql_mutex.go @@ -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)