remove threading

This commit is contained in:
wh1te909 2021-01-08 18:15:55 +00:00
parent 5d8fce21ac
commit 8134d5e24d
3 changed files with 24 additions and 6 deletions

19
.vscode/settings.json vendored
View File

@ -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,
}
}

View File

@ -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:

View File

@ -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