Add new startup script

This commit is contained in:
Thomas Sileo
2019-09-08 16:57:00 +02:00
parent 7f4be2cbc2
commit db10d8bcb5
3 changed files with 30 additions and 0 deletions

12
startup.py Normal file
View File

@@ -0,0 +1,12 @@
import app # noqa: F401 # here to init the backend
from core.activitypub import _actor_hash
from core.shared import MY_PERSON
from core.shared import p
from core.tasks import Tasks
from utils.local_actor_cache import is_actor_updated
h = _actor_hash(MY_PERSON, local=True)
if is_actor_updated(h):
Tasks.send_actor_update()
p.push({}, "/task/cleanup", schedule="@every 1h")