From 16c26de046437bb0e7f6d49a5b88bf1c60f7e750 Mon Sep 17 00:00:00 2001 From: SquirrelDevelopper Date: Tue, 12 Nov 2024 18:15:45 +0100 Subject: [PATCH] Remove unused imports and enable Ansible task profiling Removed unnecessary imports from the project, including `SsmAnsible` and `UserRepo`, to streamline the codebase. Enabled the `profile_tasks` callback in the Ansible configuration to support performance profiling. --- server/src/ansible/default-ansible.cfg | 2 +- server/src/core/startup/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/ansible/default-ansible.cfg b/server/src/ansible/default-ansible.cfg index 2b2fd830..4516be88 100644 --- a/server/src/ansible/default-ansible.cfg +++ b/server/src/ansible/default-ansible.cfg @@ -32,7 +32,7 @@ # (integer) Expiration timeout for the cache plugin data ;fact_caching_timeout=86400 # (list) List of enabled callbacks, not all callbacks need enabling, but many of those shipped with Ansible do as we don't want them activated by default. -;callbacks_enabled= +callbacks_enabled=profile_tasks # (string) When a collection is loaded that does not support the running Ansible version (with the collection metadata key `requires_ansible`). ;collections_on_ansible_version_mismatch=warning # (pathspec) Colon separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``'{{ ANSIBLE_HOME ~ "/collections" }}'``, and you want to add ``my.collection`` to that directory, it must be saved as ``'{{ ANSIBLE_HOME} ~ "/collections/ansible_collections/my/collection" }}'``. diff --git a/server/src/core/startup/index.ts b/server/src/core/startup/index.ts index eab65897..c4f140c9 100644 --- a/server/src/core/startup/index.ts +++ b/server/src/core/startup/index.ts @@ -1,10 +1,9 @@ -import { Repositories, SettingsKeys, SsmAnsible } from 'ssm-shared-lib'; +import { Repositories, SettingsKeys } from 'ssm-shared-lib'; import { getFromCache, setToCache } from '../../data/cache'; import initRedisValues from '../../data/cache/defaults'; import { ContainerCustomStackModel } from '../../data/database/model/ContainerCustomStack'; import { DeviceModel } from '../../data/database/model/Device'; import { PlaybookModel } from '../../data/database/model/Playbook'; -import UserRepo from '../../data/database/repository/UserRepo'; import { copyAnsibleCfgFileIfDoesntExist } from '../../helpers/ansible/AnsibleConfigurationHelper'; import PinoLogger from '../../logger'; import AutomationEngine from '../../modules/automations/AutomationEngine';