remove migrations

This commit is contained in:
Aine
2022-08-31 10:33:13 +03:00
parent 67f504f888
commit 104e948b9c
10 changed files with 10 additions and 54 deletions

26
bot/mutex.go Normal file
View File

@@ -0,0 +1,26 @@
package bot
import (
"sync"
"maunium.net/go/mautrix/id"
)
func (b *Bot) lock(roomID id.RoomID) {
_, ok := b.mu[roomID]
if !ok {
b.mu[roomID] = &sync.Mutex{}
}
b.mu[roomID].Lock()
}
func (b *Bot) unlock(roomID id.RoomID) {
_, ok := b.mu[roomID]
if !ok {
return
}
b.mu[roomID].Unlock()
delete(b.mu, roomID)
}