Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/core/loader.py
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | def get_save_data_path(self): | ||||
os.makedirs(path, exist_ok=True) | os.makedirs(path, exist_ok=True) | ||||
self.__save_data_path = path | self.__save_data_path = path | ||||
return self.__save_data_path | return self.__save_data_path | ||||
@retry(retry_on_exception=retry_loading, stop_max_attempt_number=3) | @retry(retry_on_exception=retry_loading, stop_max_attempt_number=3) | ||||
def send_origin(self, origin): | def send_origin(self, origin): | ||||
log_id = str(uuid.uuid4()) | log_id = str(uuid.uuid4()) | ||||
self.log.debug('Creating %s origin for %s' % (origin['type'], | self.log.debug('Creating origin for %s' % origin['url'], | ||||
origin['url']), | |||||
extra={ | extra={ | ||||
'swh_type': 'storage_send_start', | 'swh_type': 'storage_send_start', | ||||
'swh_content_type': 'origin', | 'swh_content_type': 'origin', | ||||
'swh_num': 1, | 'swh_num': 1, | ||||
'swh_id': log_id | 'swh_id': log_id | ||||
}) | }) | ||||
self.storage.origin_add_one(origin) | self.storage.origin_add_one(origin) | ||||
self.log.debug('Done creating %s origin for %s' % (origin['type'], | self.log.debug('Done creating origin for %s' % origin['url'], | ||||
origin['url']), | |||||
extra={ | extra={ | ||||
'swh_type': 'storage_send_end', | 'swh_type': 'storage_send_end', | ||||
'swh_content_type': 'origin', | 'swh_content_type': 'origin', | ||||
'swh_num': 1, | 'swh_num': 1, | ||||
'swh_id': log_id | 'swh_id': log_id | ||||
}) | }) | ||||
@retry(retry_on_exception=retry_loading, stop_max_attempt_number=3) | @retry(retry_on_exception=retry_loading, stop_max_attempt_number=3) | ||||
▲ Show 20 Lines • Show All 732 Lines • Show Last 20 Lines |