mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-07-03 22:08:22 +00:00
Refactor Omada client initialization: move instantiation to add_new_devices_to_omada task
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m32s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m32s
This commit is contained in:
@ -15,8 +15,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
env.read_env(os.path.join(BASE_DIR, ".env"))
|
env.read_env(os.path.join(BASE_DIR, ".env"))
|
||||||
|
|
||||||
omada_client = Omada()
|
|
||||||
|
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def add(x, y):
|
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.
|
:param new_devices: List of new device names to add.
|
||||||
"""
|
"""
|
||||||
logger.info("Running add new devices to Omada task...")
|
logger.info("Running add new devices to Omada task...")
|
||||||
|
omada_client = Omada()
|
||||||
omada_client.add_new_devices_to_omada(new_devices)
|
omada_client.add_new_devices_to_omada(new_devices)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user