Skip to content

Commit dd51e0a

Browse files
committed
fix fn1FA considerar rol de apoderado, fn2FA fix consulta que contaba 2 veces inconsistencia, fix modo sequential usa procesos
1 parent 24bd1cb commit dd51e0a

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

ede/ede/checkSQLiteEDE.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ def execute(self):
335335
f"Sistema ejecutandose con restrición de tiempo de {self.args.time} segundos...")
336336

337337
if "sequential" in dir(self.args) and self.args.sequential:
338-
return_dict = dict()
339-
#return_dict = self.execute_sequentially(conn)
340-
self.execute_sequentially(conn, return_dict)
338+
#return_dict = dict()
339+
#self.execute_sequentially(conn, return_dict)
340+
return_dict = self.execute_parallel(conn, sequential=True)
341341
else:
342342

343343
return_dict = self.execute_parallel(conn)
@@ -374,7 +374,7 @@ def execute_sequentially(self, conn, return_dict):
374374
except Exception as e:
375375
logger.error(f"Error general en ejecución secuencial: {e}")
376376
return False
377-
def execute_parallel(self, conn):
377+
def execute_parallel(self, conn, sequential=False):
378378
try:
379379
manager = Manager()
380380
return_dict = manager.dict()
@@ -395,6 +395,11 @@ def execute_parallel(self, conn):
395395
for p in jobs:
396396
logger.info(f"{p.name} iniciando...")
397397
p.start()
398+
if sequential:
399+
start_time = datetime.now()
400+
p.join()
401+
timediff = (datetime.now()-start_time).total_seconds()
402+
logger.info(f"function: {p.name}, time elapsed: {timediff}")
398403

399404
while True:
400405
time += 1

ede/ede/validation_functions/fn1_registro_entrega_informacion/fn1FA.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def fn1FA(conn, return_dict):
4949
AND A.RecordEndDateTime IS NULL
5050
AND B.RecordEndDateTime IS NULL
5151
WHERE A.personId = ?
52+
AND A.RefPersonRelationshipId = 31
5253
AND B.RoleId = 15;"""
5354

5455
# OBTENGO ID DE INCIDENTE ASOCIADO

ede/ede/validation_functions/fn2_registro_matricula/fn2FA.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def fn2FA(conn, return_dict):
2828
results = []
2929
try:
3030
results = ejecutar_sql(conn, """--sql
31-
select count(distinct PersonId)-(select count(distinct PersonId) from OrganizationPersonRole
32-
where RoleId=6 --Estudiante
33-
and ExitDate is not null)
31+
select count(distinct PersonId)
3432
from OrganizationPersonRole
35-
where EntryDate is not null and RoleId=6 ;
33+
where RoleId=6
34+
and EntryDate is not null
35+
and ExitDate is null ;
3636
""")
3737
except Exception as e:
3838
logger.info(f"Resultado: {results} -> {str(e)}")

0 commit comments

Comments
 (0)