add per-room mutex, possibly fixes #8

This commit is contained in:
Aine
2022-08-27 22:10:22 +03:00
parent 9484758f33
commit d1c48b9b31
4 changed files with 38 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ type Bot struct {
rooms sync.Map
log *logger.Logger
lp *linkpearl.Linkpearl
mu map[id.RoomID]*sync.Mutex
handledMembershipEvents sync.Map
}
@@ -35,6 +36,7 @@ func New(lp *linkpearl.Linkpearl, log *logger.Logger, prefix, domain string, noo
rooms: sync.Map{},
log: log,
lp: lp,
mu: map[id.RoomID]*sync.Mutex{},
}
}