def get_single_record(self) -> dict:
return self.select().get()
def get_top_lemmy_instances(self, count=25) -> list[Model]:
# TODO Add env var for count
if not os.getenv("TEST_MODE"):
count = int(os.getenv("NUMBER_OF_SERVERS"))
logging.info("Number of Rows:" + str(DbAccess.select().count()))
d = (
DbAccess.select()
.where(DbAccess.software_name == "Lemmy")
.order_by(DbAccess.stats_monthly_active_users)
.limit(count)
)
info = []
for i in d:
https://api.github.com/Jelloeater/fedi_gatus/blob/4fb4183ee8862863d177fbeb574e4f9d208bd9d5/fedi_gatus/shared/db.py#L76