worker-automate-hub 0.4.440__tar.gz → 0.4.441__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/PKG-INFO +1 -1
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/pyproject.toml +1 -1
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/client.py +0 -48
- worker_automate_hub-0.4.441/worker_automate_hub/api/rpa_fila_service.py +58 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/worker.py +4 -3
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/README.md +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/util.py +0 -0
- {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/client.py
RENAMED
@@ -45,33 +45,6 @@ async def get_new_task(stop_event: threading.Event) -> RpaProcessoEntradaDTO:
|
|
45
45
|
)
|
46
46
|
return None
|
47
47
|
|
48
|
-
async def burnQueue(id_fila: str):
|
49
|
-
env_config, _ = load_env_config()
|
50
|
-
try:
|
51
|
-
|
52
|
-
headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
|
53
|
-
|
54
|
-
|
55
|
-
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
56
|
-
async with session.delete(
|
57
|
-
f"{env_config["API_BASE_URL"]}/fila/burn-queue/{id_fila}",
|
58
|
-
headers=headers_basic,
|
59
|
-
) as response:
|
60
|
-
if response.status == 200:
|
61
|
-
logger.info("Fila excluida com sucesso.")
|
62
|
-
console.print("\nFila excluida com sucesso.\n", style="bold green")
|
63
|
-
else:
|
64
|
-
logger.error(f"Erro ao excluir a fila: {response.content}")
|
65
|
-
console.print(f"Erro ao excluir a fila: {response.content}", style="bold red")
|
66
|
-
|
67
|
-
except Exception as e:
|
68
|
-
err_msg = f"Erro remover registro da fila: {e}"
|
69
|
-
logger.error(err_msg)
|
70
|
-
console.print(
|
71
|
-
f"{err_msg}\n",
|
72
|
-
style="bold red",
|
73
|
-
)
|
74
|
-
return None
|
75
48
|
|
76
49
|
async def notify_is_alive(stop_event: threading.Event):
|
77
50
|
env_config, _ = load_env_config()
|
@@ -348,28 +321,7 @@ async def send_gchat_message(message: str) -> None:
|
|
348
321
|
style="bold red",
|
349
322
|
)
|
350
323
|
return None
|
351
|
-
|
352
|
-
async def unlock_queue(id: str):
|
353
|
-
env_config, _ = load_env_config()
|
354
|
-
try:
|
355
|
-
headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
|
356
|
-
|
357
324
|
|
358
|
-
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
359
|
-
async with session.get(
|
360
|
-
f"{env_config["API_BASE_URL"]}/fila/unlock-queue/{id}",
|
361
|
-
headers=headers_basic,
|
362
|
-
) as response:
|
363
|
-
return await response.text()
|
364
|
-
|
365
|
-
except Exception as e:
|
366
|
-
err_msg = f"Erro ao desbloquear a fila: {e}"
|
367
|
-
logger.error(err_msg)
|
368
|
-
console.print(
|
369
|
-
f"{err_msg}\n",
|
370
|
-
style="bold red",
|
371
|
-
)
|
372
|
-
return None
|
373
325
|
|
374
326
|
|
375
327
|
def read_secret(path: str, vault_token: str):
|
@@ -0,0 +1,58 @@
|
|
1
|
+
from worker_automate_hub.config.settings import load_env_config
|
2
|
+
from worker_automate_hub.utils.logger import logger
|
3
|
+
from rich.console import Console
|
4
|
+
|
5
|
+
import aiohttp
|
6
|
+
|
7
|
+
console = Console()
|
8
|
+
|
9
|
+
|
10
|
+
async def burn_queue(id_fila: str):
|
11
|
+
env_config, _ = load_env_config()
|
12
|
+
try:
|
13
|
+
|
14
|
+
headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
|
15
|
+
|
16
|
+
|
17
|
+
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
18
|
+
async with session.delete(
|
19
|
+
f"{env_config["API_BASE_URL"]}/fila/burn-queue/{id_fila}",
|
20
|
+
headers=headers_basic,
|
21
|
+
) as response:
|
22
|
+
if response.status == 200:
|
23
|
+
logger.info("Fila excluida com sucesso.")
|
24
|
+
console.print("\nFila excluida com sucesso.\n", style="bold green")
|
25
|
+
else:
|
26
|
+
logger.error(f"Erro ao excluir a fila: {response.content}")
|
27
|
+
console.print(f"Erro ao excluir a fila: {response.content}", style="bold red")
|
28
|
+
|
29
|
+
except Exception as e:
|
30
|
+
err_msg = f"Erro remover registro da fila: {e}"
|
31
|
+
logger.error(err_msg)
|
32
|
+
console.print(
|
33
|
+
f"{err_msg}\n",
|
34
|
+
style="bold red",
|
35
|
+
)
|
36
|
+
return None
|
37
|
+
|
38
|
+
async def unlock_queue(id: str):
|
39
|
+
env_config, _ = load_env_config()
|
40
|
+
try:
|
41
|
+
headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
|
42
|
+
|
43
|
+
|
44
|
+
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
|
45
|
+
async with session.get(
|
46
|
+
f"{env_config["API_BASE_URL"]}/fila/unlock-queue/{id}",
|
47
|
+
headers=headers_basic,
|
48
|
+
) as response:
|
49
|
+
return await response.text()
|
50
|
+
|
51
|
+
except Exception as e:
|
52
|
+
err_msg = f"Erro ao desbloquear a fila: {e}"
|
53
|
+
logger.error(err_msg)
|
54
|
+
console.print(
|
55
|
+
f"{err_msg}\n",
|
56
|
+
style="bold red",
|
57
|
+
)
|
58
|
+
return None
|
@@ -3,11 +3,11 @@ import os
|
|
3
3
|
import threading
|
4
4
|
from pathlib import Path
|
5
5
|
|
6
|
+
from worker_automate_hub.api.rpa_fila_service import burn_queue, unlock_queue
|
6
7
|
import pyfiglet
|
7
8
|
from rich.console import Console
|
8
9
|
|
9
10
|
from worker_automate_hub.api.client import (
|
10
|
-
burnQueue,
|
11
11
|
get_new_task,
|
12
12
|
notify_is_alive,
|
13
13
|
send_gchat_message,
|
@@ -41,11 +41,12 @@ async def check_and_execute_tasks(stop_event: threading.Event):
|
|
41
41
|
if task is not None:
|
42
42
|
processo_existe = await is_uuid_in_tasks(task.uuidProcesso)
|
43
43
|
if processo_existe:
|
44
|
-
await
|
44
|
+
await burn_queue(task.uuidFila)
|
45
45
|
logger.info(f"Executando a task: {task.nomProcesso}")
|
46
46
|
await perform_task(task)
|
47
47
|
else:
|
48
|
-
|
48
|
+
await unlock_queue(task.uuidFila)
|
49
|
+
log_message = f"O processo [{task.nomProcesso}] não existe no Worker [{worker_config['NOME_ROBO']}] e foi devolvido para a fila."
|
49
50
|
console.print(f"\n{log_message}\n", style="yellow")
|
50
51
|
logger.error(log_message)
|
51
52
|
await send_gchat_message(log_message)
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/api/ahead_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/config/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/config/settings.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/repeat.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/retry.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/decorators/timeit.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/tasks/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/env.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/logger.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/toast.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/updater.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.440 → worker_automate_hub-0.4.441}/worker_automate_hub/utils/util.py
RENAMED
File without changes
|
File without changes
|