Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
2Shirt 2021-04-08 23:41:01 -06:00
commit 388c6302cb
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 6 additions and 2 deletions

View file

@ -49,6 +49,7 @@ DDRESCUE_SETTINGS = {
'--timeout': {'Selected': False, 'Value': '30m', },
},
}
DRIVE_POWEROFF_TIMEOUT = 90
PARTITION_TYPES = {
'GPT': {
'NTFS': 'EBD0A0A2-B9E5-4433-87C0-68B6B72699C7', # Basic Data Partition

View file

@ -1959,7 +1959,7 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True):
std.clear_screen()
warning_message = ''
def _poweroff_source_drive(idle_minutes=120):
def _poweroff_source_drive(idle_minutes):
"""Power off source drive after a while."""
source_dev = state.source.path.name
@ -2063,7 +2063,10 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True):
# Check result
if proc.poll():
# True if return code is non-zero (poll() returns None if still running)
poweroff_thread = exe.start_thread(_poweroff_source_drive)
poweroff_thread = exe.start_thread(
_poweroff_source_drive,
cfg.ddrescue.DRIVE_POWEROFF_TIMEOUT,
)
warning_message = 'Error(s) encountered, see message above'
state.update_top_panes()
if warning_message: