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

@@ -49,6 +49,8 @@ func (b *Bot) Send(ctx context.Context, email *utils.Email) error {
if !ok {
return errors.New("room not found")
}
b.lock(roomID)
defer b.unlock(roomID)
cfg, err := b.getSettings(roomID)
if err != nil {