rr- a67a5069b7 server/info: implement simple global info
For now it returns total post count and disk usage. To reduce stress on
the file system, the disk usage is cached for an hour.
2016-04-21 19:48:47 +02:00

6 lines
144 B
Python

import sqlalchemy
from szurubooru import db
def get_post_count():
return db.session.query(sqlalchemy.func.count(db.Post.post_id)).one()[0]