storage: start db migration (badger(hold))
migrating to badger, with the badgerhold frontend. So far, done: * Announcements (small, for a quick test) * Discord/Telegram/Matrix/Email most interaction with badgerhold is done through the standard Get<x>/Get<x>Key/Set<x>Key/Delete<x>Key. UserExists functions have been added for email and matrix, and those and the original ones now use a query against the database rather than sifting through every record. I've tagged these searched fields as "index" for badgerhold, although this definitely isn't used yet, and i'm not entirely sure if it'll be useful. migrateToBadger is now in migrations.go, and a temporary config key "migrated_to_badger" has been added, although it isn't being used yet, migration is just running every time during development.
This commit is contained in:
+4
-4
@@ -511,8 +511,8 @@ func (app *appContext) ResetMyPassword(gc *gin.Context) {
|
||||
var pwr InternalPWR
|
||||
var err error
|
||||
|
||||
jfID := app.ReverseUserSearch(address)
|
||||
if jfID == "" {
|
||||
jfUser, ok := app.ReverseUserSearch(address)
|
||||
if !ok {
|
||||
app.debug.Printf("Ignoring PWR request: User not found")
|
||||
|
||||
for range timerWait {
|
||||
@@ -521,7 +521,7 @@ func (app *appContext) ResetMyPassword(gc *gin.Context) {
|
||||
}
|
||||
return
|
||||
}
|
||||
pwr, err = app.GenInternalReset(jfID)
|
||||
pwr, err = app.GenInternalReset(jfUser.ID)
|
||||
if err != nil {
|
||||
app.err.Printf("Failed to get user from Jellyfin: %v", err)
|
||||
for range timerWait {
|
||||
@@ -550,7 +550,7 @@ func (app *appContext) ResetMyPassword(gc *gin.Context) {
|
||||
return
|
||||
}
|
||||
return
|
||||
} else if err := app.sendByID(msg, jfID); err != nil {
|
||||
} else if err := app.sendByID(msg, jfUser.ID); err != nil {
|
||||
app.err.Printf("Failed to send password reset message to \"%s\": %v", address, err)
|
||||
} else {
|
||||
app.info.Printf("Sent password reset message to \"%s\"", address)
|
||||
|
||||
Reference in New Issue
Block a user