Skip to content

Commit

Permalink
added decorator to close threaded db connections (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
alhogan authored Feb 15, 2024
1 parent 09cb864 commit 1bc4163
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nautobot_golden_config/nornir_plays/config_deployment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nornir job for deploying configurations."""

from datetime import datetime

from nautobot.dcim.models import Device
Expand All @@ -13,11 +14,13 @@
from nornir_nautobot.plugins.tasks.dispatcher import dispatcher
from nornir_nautobot.utils.logger import NornirLogger

from nautobot_golden_config.utilities.db_management import close_threaded_db_connections
from nautobot_golden_config.nornir_plays.processor import ProcessGoldenConfig

InventoryPluginRegister.register("nautobot-inventory", NautobotORMInventory)


@close_threaded_db_connections
def run_deployment(task: Task, logger: NornirLogger, commit: bool, config_plan_qs, deploy_job_result) -> Result:
"""Deploy configurations to device."""
obj = task.host.data["obj"]
Expand Down

0 comments on commit 1bc4163

Please sign in to comment.