Fix comparison with NULL when listing PDSs

main
Max Ignatenko 2024-02-23 15:22:22 +00:00
parent 6bb2e5a1de
commit ddde20a014
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ func (l *Lister) run(ctx context.Context) {
remote := pds.PDS{} remote := pds.PDS{}
if err := db.Model(&remote). if err := db.Model(&remote).
Where("disabled=false and (last_list is null or last_list < ?)", time.Now().Add(-l.listRefreshInterval)). Where("(disabled=false or disabled is null) and (last_list is null or last_list < ?)", time.Now().Add(-l.listRefreshInterval)).
Take(&remote).Error; err != nil { Take(&remote).Error; err != nil {
if !errors.Is(err, gorm.ErrRecordNotFound) { if !errors.Is(err, gorm.ErrRecordNotFound) {
log.Error().Err(err).Msgf("Failed to query DB for a PDS to list repos from: %s", err) log.Error().Err(err).Msgf("Failed to query DB for a PDS to list repos from: %s", err)