Jelloeater / fedi_gatus

Generates Gatus YAML configs from Fediverse Data [CHAT@ https://matrix.to/#/#lemmy-status:matrix.org]
https://lemmy-status.org
MIT License
5 stars 0 forks source link

Add env var for count #27

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

https://api.github.com/Jelloeater/fedi_gatus/blob/4fb4183ee8862863d177fbeb574e4f9d208bd9d5/fedi_gatus/shared/db.py#L76


    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:
github-actions[bot] commented 1 year ago

Closed in 5de0010b1cb487506d8d5ba72f1e3540106b8a7a