From fd1d8a2a0958e4256ac0bbd77a982c5fc2274546 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 14 Jan 2021 00:06:15 -0800 Subject: [PATCH] fix compilation --- weed/filer/mysql/mysql_store.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weed/filer/mysql/mysql_store.go b/weed/filer/mysql/mysql_store.go index 62b9b287a..b9f7f06dd 100644 --- a/weed/filer/mysql/mysql_store.go +++ b/weed/filer/mysql/mysql_store.go @@ -3,6 +3,7 @@ package mysql import ( "database/sql" "fmt" + "time" "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/filer/abstract_sql" @@ -66,7 +67,7 @@ func (store *MysqlStore) initialize(user, password, hostname string, port int, d store.DB.SetMaxIdleConns(maxIdle) store.DB.SetMaxOpenConns(maxOpen) - store.DB.SetConnMaxLifetime(maxLifetimeSeconds*time.Second) + store.DB.SetConnMaxLifetime(time.Duration(maxLifetimeSeconds)*time.Second) if err = store.DB.Ping(); err != nil { return fmt.Errorf("connect to %s error:%v", sqlUrl, err)