Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9345828
D588.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D588.diff
View Options
diff --git a/swh/archiver/checker.py b/swh/archiver/checker.py
--- a/swh/archiver/checker.py
+++ b/swh/archiver/checker.py
@@ -36,6 +36,7 @@
}
}),
'batch_size': ('int', 1000),
+ 'log_tag': ('str', 'objstorage.checker')
}
CONFIG_BASE_FILENAME = 'objstorage/objstorage_checker'
@@ -46,6 +47,7 @@
self.config = self.parse_config_file()
self.objstorage = get_objstorage(**self.config['storage'])
self.batch_size = self.config['batch_size']
+ self.logger = logging.getLogger(self.config['log_tag'])
def run_as_daemon(self):
""" Start the check routine and perform it forever.
@@ -56,8 +58,8 @@
while True:
try:
self.run()
- except:
- pass
+ except Exception:
+ self.logger.exception('Unexpected error.')
def run(self):
""" Check a batch of content.
@@ -108,25 +110,8 @@
class LogContentChecker(BaseContentChecker):
""" Content integrity checker that just log detected errors.
"""
-
- DEFAULT_CONFIG = {
- 'storage': ('dict', {
- 'cls': 'pathslicing',
- 'args': {
- 'root': '/srv/softwareheritage/objects',
- 'slicing': '0:2/2:4/4:6'
- }
- }),
- 'batch_size': ('int', 1000),
- 'log_tag': ('str', 'objstorage.checker')
- }
-
CONFIG_BASE_FILENAME = 'objstorage/log_checker'
- def __init__(self):
- super().__init__()
- self.logger = logging.getLogger(self.config['log_tag'])
-
def corrupted_content(self, obj_id):
""" Perform an action to treat with a corrupted content.
"""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 3:32 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216600
Attached To
D588: flake8: except: pass is evil
Event Timeline
Log In to Comment