Skip to content

Commit

Permalink
Merge pull request #1970 from ergochat/devel+issue1969_alignment
Browse files Browse the repository at this point in the history
fix #1969
  • Loading branch information
slingamn authored Jun 10, 2022
2 parents 810ec75 + 69448b1 commit c0e7aac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions irc/mysql/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
type e struct{}

type MySQL struct {
timeout int64
timeout *int64
trackAccountMessages uint32
db *sql.DB
logger *logger.Manager
Expand All @@ -63,13 +63,14 @@ type MySQL struct {
}

func (mysql *MySQL) Initialize(logger *logger.Manager, config Config) {
mysql.timeout = new(int64)
mysql.logger = logger
mysql.wakeForgetter = make(chan e, 1)
mysql.SetConfig(config)
}

func (mysql *MySQL) SetConfig(config Config) {
atomic.StoreInt64(&mysql.timeout, int64(config.Timeout))
atomic.StoreInt64(mysql.timeout, int64(config.Timeout))
var trackAccountMessages uint32
if config.TrackAccountMessages {
trackAccountMessages = 1
Expand Down Expand Up @@ -554,7 +555,7 @@ func (mysql *MySQL) prepareStatements() (err error) {
}

func (mysql *MySQL) getTimeout() time.Duration {
return time.Duration(atomic.LoadInt64(&mysql.timeout))
return time.Duration(atomic.LoadInt64(mysql.timeout))
}

func (mysql *MySQL) isTrackingAccountMessages() bool {
Expand Down

0 comments on commit c0e7aac

Please sign in to comment.