From 8134d5e24d50832860316a917bf1fe3cf3ff5add Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 8 Jan 2021 18:15:55 +0000 Subject: [PATCH] remove threading --- .vscode/settings.json | 19 +++++++++++++++++++ api/tacticalrmm/agents/tasks.py | 9 ++++----- api/tacticalrmm/tacticalrmm/settings.py | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index bc3b5a37..757881bf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -41,4 +41,23 @@ "**/*.zip": true }, }, + "go.useLanguageServer": true, + "[go]": { + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": false, + }, + "editor.snippetSuggestions": "none", + }, + "[go.mod]": { + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true, + }, + }, + "gopls": { + "usePlaceholders": true, + "completeUnimported": true, + "staticcheck": true, + } } \ No newline at end of file diff --git a/api/tacticalrmm/agents/tasks.py b/api/tacticalrmm/agents/tasks.py index bfa5e69f..378517f0 100644 --- a/api/tacticalrmm/agents/tasks.py +++ b/api/tacticalrmm/agents/tasks.py @@ -3,7 +3,6 @@ from loguru import logger from time import sleep import random import requests -from concurrent.futures import ThreadPoolExecutor from packaging import version as pyver from typing import List @@ -40,16 +39,16 @@ def check_in_task() -> None: agents: List[int] = [ i.pk for i in q if pyver.parse(i.version) >= pyver.parse("1.1.12") ] - with ThreadPoolExecutor() as executor: - executor.map(_check_in_full, agents) + for agent in agents: + _check_in_full(agent) @app.task def monitor_agents_task() -> None: q = Agent.objects.all() agents: List[int] = [i.pk for i in q if i.has_nats and i.status != "online"] - with ThreadPoolExecutor() as executor: - executor.map(_check_agent_service, agents) + for agent in agents: + _check_agent_service(agent) def agent_update(pk: int) -> str: diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index 681e5af7..f29e4c89 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -15,7 +15,7 @@ EXE_DIR = os.path.join(BASE_DIR, "tacticalrmm/private/exe") AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.2.21" +TRMM_VERSION = "0.2.22" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser