diff --git a/ogn/collect/celery.py b/ogn/collect/celery.py index bc89364..dd8f289 100644 --- a/ogn/collect/celery.py +++ b/ogn/collect/celery.py @@ -9,7 +9,7 @@ from celery.signals import worker_init, worker_shutdown app = Celery('ogn.collect', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0', - include=["ogn.collect.fetchddb"]) + include=["ogn.collect.fetchddb", "ogn.collect.logbook"]) DB_URI = 'sqlite:///beacons.db' diff --git a/ogn/commands/logbook.py b/ogn/commands/logbook.py index 7b2484a..116409c 100644 --- a/ogn/commands/logbook.py +++ b/ogn/commands/logbook.py @@ -9,11 +9,19 @@ from sqlalchemy.sql.expression import true, false, label from ogn.model import Device, TakeoffLanding from ogn.commands.dbutils import session +from ogn.collect.logbook import compute_takeoff_and_landing from manager import Manager manager = Manager() +@manager.command +def compute(): + """Compute takeoffs and landings.""" + print("Compute takeoffs and landings...") + compute_takeoff_and_landing.delay() + + @manager.command def show(airport_name, latitude, longitude, altitude): """Show a logbook for located at given position."""