Fix comparison with NULL when listing PDSs
parent
6bb2e5a1de
commit
ddde20a014
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue