@@ -196,7 +196,7 @@ def __init__(self):
196196 self .get_parameter ("error_code_topic" ).get_parameter_value ().string_value
197197 )
198198
199- self .declare_parameter ("waiting_data_minutes" , 10 )
199+ self .declare_parameter ("waiting_data_minutes" , 60 )
200200 self .waiting_minutes = (
201201 self .get_parameter ("waiting_data_minutes" )
202202 .get_parameter_value ()
@@ -216,9 +216,9 @@ def __init__(self):
216216 _log .info (
217217 f"[node params] bag_storage_path: { self .bag_storage_path } , "
218218 f"error_code_topic: { self .error_code_topic } , "
219- f"waiting_data_minutes: { self .waiting_minutes } ,"
220- f"use_service: { self .use_service } ,"
221- f"cos_agent_path: { cos_agent_path } ,"
219+ f"waiting_data_minutes: { self .waiting_minutes } , "
220+ f"use_service: { self .use_service } , "
221+ f"cos_agent_path: { cos_agent_path } , "
222222 f"version: { self .version } "
223223 )
224224
@@ -550,9 +550,13 @@ def _write_upload_info_to_cos_state(
550550 json .dump (info .to_dict (), fp , indent = 4 )
551551
552552 def _collect_bag_files (self , trigger_time , cache_data ):
553- bag_interval_minutes = 2
554- bags_to_upload = []
555553 bag_files = []
554+ bags_to_upload = []
555+ bag_interval_minutes = 2
556+
557+ if not os .path .exists (self .bag_storage_path ):
558+ return False , bags_to_upload
559+
556560 files = os .listdir (self .bag_storage_path )
557561 for bag_file in files :
558562 bag_full_path = os .path .join (self .bag_storage_path , bag_file )
@@ -609,10 +613,14 @@ def _collect_bag_files(self, trigger_time, cache_data):
609613
610614 def _collect_log_files (self ):
611615 log_files = []
616+ logs_to_upload = []
612617 log_directory = os .path .join (
613618 self .log_storage_path , datetime .datetime .now ().strftime ("%Y%m%d" )
614619 )
615620
621+ if not os .path .exists (log_directory ):
622+ return logs_to_upload
623+
616624 for node_name in os .listdir (log_directory ):
617625 node_log_dir = os .path .join (log_directory , node_name )
618626 if node_name == "edge_gateway" :
@@ -653,7 +661,6 @@ def _collect_log_files(self):
653661 if file_to_update != "" :
654662 log_files .append (file_to_update )
655663
656- logs_to_upload = []
657664 for log_file in log_files :
658665 logs_to_upload .append (
659666 {
0 commit comments