diff --git a/api/tasks.py b/api/tasks.py index 3c2bf75..d4c1890 100644 --- a/api/tasks.py +++ b/api/tasks.py @@ -15,8 +15,6 @@ logger = logging.getLogger(__name__) env.read_env(os.path.join(BASE_DIR, ".env")) -omada_client = Omada() - @app.task def add(x, y): @@ -64,6 +62,7 @@ def add_new_devices_to_omada(new_devices: list[dict]): :param new_devices: List of new device names to add. """ logger.info("Running add new devices to Omada task...") + omada_client = Omada() omada_client.add_new_devices_to_omada(new_devices)