@@ -228,13 +228,11 @@ def kill_subprocess(subproc,print_func=print):
228
228
229
229
if windows :
230
230
kill_cmd = ['taskkill' , '/F' , '/T' , '/PID' , str (pid )]
231
- #print_func( ('info',f'executing: {kill_cmd}') )
232
231
print_func ( ('info' ,f'killing pid: { pid } ' ) )
233
232
subprocess_run (kill_cmd )
234
233
else :
235
234
print_func ( ('info' ,f'killing process group of pid { pid } ' ) )
236
235
killpg (getpgid (pid ), SIGTERM )
237
- #print_func( ('info',f'killing process group done') )
238
236
239
237
except Exception as ke :
240
238
print_func ( ('error' ,f'kill_subprocess error: { ke } ' ) )
@@ -1263,10 +1261,6 @@ def create(self,label='',scan_path=''):
1263
1261
self .update_sorted ()
1264
1262
return new_record
1265
1263
1266
- #def load_record(self):
1267
- #self.records.add(new_record)
1268
- # pass
1269
-
1270
1264
def read_records_pre (self ):
1271
1265
try :
1272
1266
with scandir (self .db_dir ) as res :
@@ -1527,7 +1521,6 @@ def create_new_record(self,temp_dir,update_callback):
1527
1521
self .log .info (f'create_new_record' )
1528
1522
self_log_info = self .log .info
1529
1523
1530
-
1531
1524
new_file_path = sep .join ([self .db_dir ,f'rep.{ int (time ())} .dat' ])
1532
1525
1533
1526
command = self .record_exe ()
@@ -1613,7 +1606,6 @@ def threaded_run(command,results_semi_list,info_semi_list,processes_semi_list):
1613
1606
else :
1614
1607
info_semi_list [0 ]= line_strip
1615
1608
except Exception as e :
1616
- print (f'threaded_run work error:{ e } line:{ line } ' )
1617
1609
info_semi_list [0 ]= f'threaded_run work error:{ e } line:{ line } '
1618
1610
self_log_info (f'threaded_run work error:{ e } line:{ line } ' )
1619
1611
else :
@@ -1629,15 +1621,13 @@ def threaded_run(command,results_semi_list,info_semi_list,processes_semi_list):
1629
1621
job .start ()
1630
1622
job_is_alive = job .is_alive
1631
1623
1632
- aborted = False
1633
1624
###########################################
1634
1625
while job_is_alive ():
1635
1626
subprocess = processes_semi_list [0 ]
1636
1627
if subprocess :
1637
1628
if self .abort_action :
1638
1629
send_signal (subprocess ,temp_dir ,0 )
1639
1630
self .abort_action = False
1640
- aborted = True
1641
1631
if self .abort_action_single :
1642
1632
send_signal (subprocess ,temp_dir ,1 )
1643
1633
self .abort_action_single = False
@@ -1646,15 +1636,15 @@ def threaded_run(command,results_semi_list,info_semi_list,processes_semi_list):
1646
1636
job .join ()
1647
1637
###########################################
1648
1638
1649
- if not aborted :
1650
- new_record = self .create ()
1639
+ #nie wiadomo czy przerwano na skanie czy cde
1640
+ new_record = self .create ()
1651
1641
1652
- if res := new_record .load (new_file_path ) :
1653
- self .log .warning ('removing:%s' ,new_file_path )
1654
- self .records .remove (new_record )
1655
- print (res )
1656
- else :
1657
- update_callback (new_record )
1642
+ if res := new_record .load (new_file_path ) :
1643
+ self .log .warning ('removing:%s' ,new_file_path )
1644
+ self .records .remove (new_record )
1645
+ self_log_info (res )
1646
+ else :
1647
+ update_callback (new_record )
1658
1648
1659
1649
return True
1660
1650
@@ -1721,7 +1711,6 @@ def find_items_in_records(self,
1721
1711
############################################################
1722
1712
1723
1713
max_processes = cpu_count ()
1724
- #max_processes = 1
1725
1714
1726
1715
records_to_process_len = len (records_to_process )
1727
1716
0 commit comments