mirror of
https://github.com/ergochat/ergo.git
synced 2025-05-06 14:47:29 +02:00
don't write to mysql while holding joinPartMutex
This commit is contained in:
parent
4472683d58
commit
282e7a4d57
@ -682,8 +682,6 @@ func (channel *Channel) Join(client *Client, key string, isSajoin bool, rb *Resp
|
|||||||
|
|
||||||
client.server.logger.Debug("join", fmt.Sprintf("%s joined channel %s", details.nick, chname))
|
client.server.logger.Debug("join", fmt.Sprintf("%s joined channel %s", details.nick, chname))
|
||||||
|
|
||||||
var message utils.SplitMessage
|
|
||||||
|
|
||||||
givenMode := func() (givenMode modes.Mode) {
|
givenMode := func() (givenMode modes.Mode) {
|
||||||
channel.joinPartMutex.Lock()
|
channel.joinPartMutex.Lock()
|
||||||
defer channel.joinPartMutex.Unlock()
|
defer channel.joinPartMutex.Unlock()
|
||||||
@ -707,22 +705,23 @@ func (channel *Channel) Join(client *Client, key string, isSajoin bool, rb *Resp
|
|||||||
|
|
||||||
channel.regenerateMembersCache()
|
channel.regenerateMembersCache()
|
||||||
|
|
||||||
// no history item for fake persistent joins
|
|
||||||
if rb != nil {
|
|
||||||
message = utils.MakeMessage("")
|
|
||||||
histItem := history.Item{
|
|
||||||
Type: history.Join,
|
|
||||||
Nick: details.nickMask,
|
|
||||||
AccountName: details.accountName,
|
|
||||||
Message: message,
|
|
||||||
}
|
|
||||||
histItem.Params[0] = details.realname
|
|
||||||
channel.AddHistoryItem(histItem)
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
var message utils.SplitMessage
|
||||||
|
// no history item for fake persistent joins
|
||||||
|
if rb != nil {
|
||||||
|
message = utils.MakeMessage("")
|
||||||
|
histItem := history.Item{
|
||||||
|
Type: history.Join,
|
||||||
|
Nick: details.nickMask,
|
||||||
|
AccountName: details.accountName,
|
||||||
|
Message: message,
|
||||||
|
}
|
||||||
|
histItem.Params[0] = details.realname
|
||||||
|
channel.AddHistoryItem(histItem)
|
||||||
|
}
|
||||||
|
|
||||||
client.addChannel(channel)
|
client.addChannel(channel)
|
||||||
|
|
||||||
var modestr string
|
var modestr string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user