From bc5ec89b7049d924b4eea85d232e06c39a8941fd Mon Sep 17 00:00:00 2001 From: ys-0212 <65277457+qi-0826@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:32:38 +0800 Subject: [PATCH 1/2] docs: fix typos (#1038) --- bridge-history-api/abi/backend_abi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridge-history-api/abi/backend_abi.go b/bridge-history-api/abi/backend_abi.go index 940cd2df10..c4615862ff 100644 --- a/bridge-history-api/abi/backend_abi.go +++ b/bridge-history-api/abi/backend_abi.go @@ -45,7 +45,7 @@ var ( L2BatchWithdrawERC721Sig common.Hash L2BatchWithdrawERC1155Sig common.Hash - // scroll mono repo + // scroll monorepo // ScrollChainABI holds information about ScrollChain's context and available invokable methods. ScrollChainABI *abi.ABI @@ -323,7 +323,7 @@ type L1RelayedMessageEvent struct { MessageHash common.Hash } -// L2AppendMessageEvent represents a AppendMessage event raised by the L2MessageQueue contract. +// L2AppendMessageEvent represents an AppendMessage event raised by the L2MessageQueue contract. type L2AppendMessageEvent struct { Index *big.Int MessageHash common.Hash From 2e627f781a3f06f850954776f0f0a3112a166e97 Mon Sep 17 00:00:00 2001 From: Xargin Date: Mon, 11 Dec 2023 15:46:13 +0800 Subject: [PATCH 2/2] fix: add connection timeout for db conn pool (#1032) Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> --- bridge-history-api/utils/database.go | 2 ++ common/database/db.go | 3 +++ common/version/version.go | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bridge-history-api/utils/database.go b/bridge-history-api/utils/database.go index 916372e042..5d7383c165 100644 --- a/bridge-history-api/utils/database.go +++ b/bridge-history-api/utils/database.go @@ -74,6 +74,8 @@ func InitDB(config *config.DBConfig) (*gorm.DB, error) { return nil, pingErr } + sqlDB.SetConnMaxLifetime(time.Minute * 10) + sqlDB.SetConnMaxIdleTime(time.Minute * 5) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/database/db.go b/common/database/db.go index 8d5a54842a..322ba27115 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,6 +70,9 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } + sqlDB.SetConnMaxLifetime(time.Minute * 10) + sqlDB.SetConnMaxIdleTime(time.Minute * 5) + sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/version/version.go b/common/version/version.go index ca6aadc483..a97953e2db 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.3.42" +var tag = "v4.3.43" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {