worker-automate-hub 0.5.773__py3-none-any.whl → 0.5.775__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,41 +144,42 @@ async def get_processo(uuidProcesso: str) -> RpaProcesso:
144
144
  RpaProcesso: O processo caso tenha sido encontrado.
145
145
  """
146
146
  env_config, _ = load_env_config()
147
- try:
148
- if not uuidProcesso:
149
- raise ValueError("O uuid do processo deve ser informado")
147
+ x = 0
148
+ while x < 10:
149
+ try:
150
+ if not uuidProcesso:
151
+ raise ValueError("O uuid do processo deve ser informado")
150
152
 
151
- headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
152
- timeout = aiohttp.ClientTimeout(total=600)
153
+ headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
154
+ timeout = aiohttp.ClientTimeout(total=600)
153
155
 
154
- async with aiohttp.ClientSession(
155
- connector=aiohttp.TCPConnector(verify_ssl=True), timeout=timeout
156
- ) as session:
157
- async with session.get(
158
- f"{env_config["API_BASE_URL"]}/processo/{uuidProcesso}",
159
- headers=headers_basic,
160
- ) as response:
161
- if response.status != 200:
162
- error_content = await response.text()
163
- raise Exception(f"Erro ao obter o processo: {error_content}")
164
- res = await response.json()
165
- if type(res["campos"]) == str and res["campos"] == "{}":
166
- res["campos"] = {}
167
- return RpaProcesso(**res)
156
+ async with aiohttp.ClientSession(
157
+ connector=aiohttp.TCPConnector(verify_ssl=True), timeout=timeout
158
+ ) as session:
159
+ async with session.get(
160
+ f"{env_config["API_BASE_URL"]}/processo/{uuidProcesso}",
161
+ headers=headers_basic,
162
+ ) as response:
163
+ if response.status != 200:
164
+ x += 1
165
+ console.print(f"Erro ao obter o processo: {response.content}")
166
+ continue
167
+ else:
168
+ res = await response.json()
169
+ if type(res["campos"]) == str and res["campos"] == "{}":
170
+ res["campos"] = {}
171
+ return RpaProcesso(**res)
168
172
 
169
- except ValueError as e:
170
- logger.error(f"Erro ao obter o processo: {str(e)}")
171
- console.print(
172
- f"{e}\n",
173
- style="bold red",
174
- )
175
- except Exception as e:
176
- logger.error(f"Erro ao obter o processo: {str(e)}")
177
- console.print(
178
- f"{e}\n",
179
- style="bold red",
173
+ except ValueError as e:
174
+ x += 1
175
+ logger.error(f"Erro ao obter o processo: {str(e)}")
176
+ console.print(
177
+ f"{e}\n",
178
+ style="bold red",
180
179
  )
181
- return None
180
+ continue
181
+
182
+ return None
182
183
 
183
184
 
184
185
  async def get_workers():
@@ -3438,7 +3438,7 @@ async def check_nota_importada(xml_nota: str) -> RpaRetornoProcessoDTO:
3438
3438
  from worker_automate_hub.api.client import get_status_nf_emsys
3439
3439
 
3440
3440
  try:
3441
- max_attempts = 100
3441
+ max_attempts = 10
3442
3442
  i = 0
3443
3443
 
3444
3444
  while i < max_attempts:
@@ -3447,7 +3447,7 @@ async def check_nota_importada(xml_nota: str) -> RpaRetornoProcessoDTO:
3447
3447
  break
3448
3448
  else:
3449
3449
  console.print(f"Aguardando confirmação de nota incluida...\n")
3450
- await worker_sleep(8)
3450
+ await worker_sleep(13)
3451
3451
  i += 1
3452
3452
  try:
3453
3453
  status_nf_emsys = await get_status_nf_emsys(int(xml_nota))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.773
3
+ Version: 0.5.775
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -1,7 +1,7 @@
1
1
  worker_automate_hub/__init__.py,sha256=LV28uQvBfpPIqudGIMJmVB8E941MjXHcu8DMoX5n8AM,25
2
2
  worker_automate_hub/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  worker_automate_hub/api/ahead_service.py,sha256=QbNrZf9q7fS0s-S5fZVytqC7dINi9u2f6aB6SDrGVVA,2231
4
- worker_automate_hub/api/client.py,sha256=gKuIUhdAiMFE4YK3nR4SR2W8p1v4--7I64Pjs0oJsyM,31956
4
+ worker_automate_hub/api/client.py,sha256=QY6OgIIkkB1bSJikRfYdDhTm6Wza_J3pGdrG4Q_jW_g,32003
5
5
  worker_automate_hub/api/datalake_service.py,sha256=qw_N_OOgDKDuPbI-fdYkWWTlT4CUtFTl0VVlZ0fLM-M,3001
6
6
  worker_automate_hub/api/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  worker_automate_hub/api/helpers/api_helpers.py,sha256=SkheO2fXexeh-a4shr8Qzsz_kZhuSG0DJ7kbODctRbM,3696
@@ -98,10 +98,10 @@ worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1
98
98
  worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
99
99
  worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
100
100
  worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
101
- worker_automate_hub/utils/util.py,sha256=V2WtWoETdTrAtGA8UgeqAAVphUj9KkGSZFzYsHJFATA,210055
101
+ worker_automate_hub/utils/util.py,sha256=f0lkFbPyg5kAtNI4RHOZ12iIxfmtbq6uuS3sBUqszE8,210055
102
102
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=TOXKSHOPxy8N3-ROpTGjNIHstX0i2b8qekcj1tRvjG8,38174
103
103
  worker_automate_hub/worker.py,sha256=uhZ3f-iaQ1i8cANbljp50vkYl-Xm0_sHtjwwF_2y72o,7191
104
- worker_automate_hub-0.5.773.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
105
- worker_automate_hub-0.5.773.dist-info/METADATA,sha256=M8xKI34NhRhKgacPew9ukZuLmiNGmZ1iUokysgUc-6Q,3049
106
- worker_automate_hub-0.5.773.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
107
- worker_automate_hub-0.5.773.dist-info/RECORD,,
104
+ worker_automate_hub-0.5.775.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
105
+ worker_automate_hub-0.5.775.dist-info/METADATA,sha256=cdgJXQ-9mMEsBjVjDuBBK6l6cKA6O37hOq7qXyIZF9g,3049
106
+ worker_automate_hub-0.5.775.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
107
+ worker_automate_hub-0.5.775.dist-info/RECORD,,