mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-23 23:17:58 +00:00
fixes
This commit is contained in:
parent
fad4b7ce82
commit
162f813c05
|
@ -202,14 +202,10 @@ class CacheCleanupThread(Thread):
|
|||
|
||||
|
||||
def run(self) -> None:
|
||||
cache = get_cache(self.app)
|
||||
|
||||
while self.running.is_set():
|
||||
time.sleep(3600)
|
||||
logging.verbose("Removing old cache items")
|
||||
cache.delete_old(14)
|
||||
|
||||
cache.close()
|
||||
self.app.cache.delete_old(14)
|
||||
|
||||
|
||||
def start(self) -> None:
|
||||
|
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import Crypto
|
||||
import asyncio
|
||||
import click
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -238,9 +239,12 @@ def cli_run(ctx: click.Context, dev: bool = False) -> None:
|
|||
|
||||
if getattr(sys, 'frozen', False):
|
||||
subprocess.run([sys.executable, 'run-gunicorn'], check = False)
|
||||
return
|
||||
|
||||
ctx.obj.run(dev)
|
||||
else:
|
||||
ctx.obj.run(dev)
|
||||
|
||||
# todo: figure out why the relay doesn't quit properly without this
|
||||
os._exit(0)
|
||||
|
||||
|
||||
@cli.command('run-gunicorn')
|
||||
|
|
|
@ -170,12 +170,6 @@ class Inbox(View):
|
|||
|
||||
with self.database.session() as conn:
|
||||
for inbox in conn.execute('SELECT * FROM inboxes'):
|
||||
try:
|
||||
created = datetime.fromtimestamp(inbox['created'], tz = timezone.utc)
|
||||
|
||||
except TypeError:
|
||||
created = datetime.fromisoformat(inbox['created'])
|
||||
|
||||
inbox['created'] = created.isoformat()
|
||||
data.append(inbox)
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class HomeView(View):
|
|||
async def get(self, request: Request) -> Response:
|
||||
with self.database.session() as conn:
|
||||
config = conn.get_config_all()
|
||||
inboxes = conn.execute('SELECT * FROM inboxes').all()
|
||||
inboxes = tuple(conn.execute('SELECT * FROM inboxes').all())
|
||||
|
||||
text = HOME_TEMPLATE.format(
|
||||
host = self.config.domain,
|
||||
|
|
Loading…
Reference in a new issue