Skip to content

Commit

Permalink
feat: Improve performanc getting latest synchronized dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Jul 7, 2024
1 parent e3f46ae commit fddc0e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/modules/dataset/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unidecode
from typing import Optional

from sqlalchemy import func, or_, any_
from sqlalchemy import desc, func, or_, any_

from app.modules.dataset.models import (
Author,
Expand Down Expand Up @@ -134,7 +134,7 @@ def latest_synchronized(self):
return (
self.model.query.join(DSMetaData)
.filter(DSMetaData.dataset_doi.isnot(None))
.order_by(self.model.created_at.desc())
.order_by(desc(self.model.id))
.limit(5)
.all()
)
Expand Down

0 comments on commit fddc0e1

Please sign in to comment.