fix: do not remove empty openid teams when none are present
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Maybe resolves https://community.vikunja.io/t/empty-openid-team-cleanup-cron-error-removing-empty-openid-team-database-is-locked-error-when-exporting-data/2306/3
This commit is contained in:
parent
00a96663ba
commit
66e96322ea
@ -38,6 +38,10 @@ func RemoveEmptySSOTeams(s *xorm.Session) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(teams) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
teamIDs := make([]int64, 0, len(teams))
|
||||
for _, team := range teams {
|
||||
teamIDs = append(teamIDs, team.ID)
|
||||
@ -63,6 +67,6 @@ func RegisterEmptyOpenIDTeamCleanupCron() {
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Could not empty openid teams cleanup cron: %s", err)
|
||||
log.Fatalf("Could not register empty openid teams cleanup cron: %s", err)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user