mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
Co-authored-by: georgehao <haohongfan@gmail.com> Co-authored-by: colinlyguo <colinlyguo@users.noreply.github.com>
23 lines
390 B
Go
23 lines
390 B
Go
package api
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/go-redis/redis/v8"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var (
|
|
// HistoryCtrler is controller instance
|
|
HistoryCtrler *HistoryController
|
|
|
|
initControllerOnce sync.Once
|
|
)
|
|
|
|
// InitController inits Controller with database
|
|
func InitController(db *gorm.DB, redis *redis.Client) {
|
|
initControllerOnce.Do(func() {
|
|
HistoryCtrler = NewHistoryController(db, redis)
|
|
})
|
|
}
|